avformat/rtsp: pass return code from ffurl_open() on its failure
authorAndrey Utkin <andrey.utkin@corp.bluecherry.net>
Thu, 23 Oct 2014 16:55:45 +0000 (20:55 +0400)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 23 Oct 2014 21:53:14 +0000 (23:53 +0200)
Previously, AVERROR(EIO) was returned. Now the value is passed from
lower level, thus it is possible to distinguish ECONNREFUSED, ETIMEDOUT,
ENETUNREACH etc.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rtsp.c

index 17f14241be050575b3fd8b7a5e9907e2e12d693f..0a88164d84c707761cb3b69924440956fbf64b78 100644 (file)
@@ -1737,13 +1737,14 @@ redirect:
             goto fail;
         }
     } else {
+        int ret;
         /* open the tcp connection */
         ff_url_join(tcpname, sizeof(tcpname), lower_rtsp_proto, NULL,
                     host, port,
                     "?timeout=%d", rt->stimeout);
-        if (ffurl_open(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
-                       &s->interrupt_callback, NULL) < 0) {
-            err = AVERROR(EIO);
+        if ((ret = ffurl_open(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
+                       &s->interrupt_callback, NULL)) < 0) {
+            err = ret;
             goto fail;
         }
         rt->rtsp_hd_out = rt->rtsp_hd;