[FFmpeg-cvslog] rtsp: make ff_sdp_parse return value forwarded

Luca Barbato git
Sun Jan 30 04:15:54 CET 2011


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Fri Jan 28 03:12:22 2011 +0100| [b351baa070beede5d110974544782ac80e21bc90] | committer: Michael Niedermayer

rtsp: make ff_sdp_parse return value forwarded

the sdp demuxer did not forward it at all while the rtsp demuxer assumed
a single kind of error
(cherry picked from commit f81c7ac70a7e5e82b0ab0839faf8d22d555efb9d)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b351baa070beede5d110974544782ac80e21bc90
---

 libavformat/rtsp.c    |    3 ++-
 libavformat/rtspdec.c |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index a56ff99..dec6995 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1795,8 +1795,9 @@ static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap)
     }
     content[size] ='\0';
 
-    ff_sdp_parse(s, content);
+    err = ff_sdp_parse(s, content);
     av_free(content);
+    if (err) goto fail;
 
     /* open each RTP stream */
     for (i = 0; i < rt->nb_rtsp_streams; i++) {
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 55996e3..f95f7c3 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -136,7 +136,7 @@ int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
     ret = ff_sdp_parse(s, (const char *)content);
     av_freep(&content);
     if (ret < 0)
-        return AVERROR_INVALIDDATA;
+        return ret;
 
     return 0;
 }




More information about the ffmpeg-cvslog mailing list