diff options
author | Andrey Utkin <andrey.utkin@corp.bluecherry.net> | 2014-10-23 20:55:45 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-23 23:53:14 +0200 |
commit | 08e6832a94cc1de441625f7834db739d131e23a6 (patch) | |
tree | 139ebdad4a023a7b58ef665fe74a8c8d670e0446 | |
parent | 7f2af3f56b3d69149b18e062664582c858631791 (diff) | |
download | ffmpeg-08e6832a94cc1de441625f7834db739d131e23a6.tar.gz |
avformat/rtsp: pass return code from ffurl_open() on its failure
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>
-rw-r--r-- | libavformat/rtsp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 17f14241be..0a88164d84 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -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; |