From 08e6832a94cc1de441625f7834db739d131e23a6 Mon Sep 17 00:00:00 2001 From: Andrey Utkin Date: Thu, 23 Oct 2014 20:55:45 +0400 Subject: [PATCH] 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 --- libavformat/rtsp.c | 7 ++++--- 1 file 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;