[FFmpeg-cvslog] rtsp: Discard the dynamic handler, if it has an alloc function which failed

Martin Storsjö git at videolan.org
Tue Nov 8 02:22:01 CET 2011


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sun Nov  6 23:50:39 2011 +0200| [4b3dc857e416f9ec187cb14fd133226456ba7f91] | committer: Martin Storsjö

rtsp: Discard the dynamic handler, if it has an alloc function which failed

Signed-off-by: Martin Storsjö <martin at martin.st>

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

 libavformat/rtsp.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c673c35..84cf922 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -172,8 +172,11 @@ static void init_rtp_handler(RTPDynamicProtocolHandler *handler,
         return;
     codec->codec_id          = handler->codec_id;
     rtsp_st->dynamic_handler = handler;
-    if (handler->alloc)
+    if (handler->alloc) {
         rtsp_st->dynamic_protocol_context = handler->alloc();
+        if (!rtsp_st->dynamic_protocol_context)
+            rtsp_st->dynamic_handler = NULL;
+    }
 }
 
 /* parse the rtpmap description: <codec_name>/<clock_rate>[/<other params>] */



More information about the ffmpeg-cvslog mailing list