diff libmpdemux/demux_rtp_codec.cpp @ 29451:6aca83f5ba73

Fix a crash when playing some H264 over rtsp streams: Do pass an AVCodecContext to the H264 parser.
author cehoyos
date Tue, 11 Aug 2009 18:28:26 +0000
parents 80c6dd85f7f8
children 3a154fb8f85c
line wrap: on
line diff
--- a/libmpdemux/demux_rtp_codec.cpp	Tue Aug 11 18:21:31 2009 +0000
+++ b/libmpdemux/demux_rtp_codec.cpp	Tue Aug 11 18:28:26 2009 +0000
@@ -30,6 +30,7 @@
 #ifdef CONFIG_LIBAVCODEC
 AVCodecParserContext * h264parserctx;
 #endif
+void *avcctx;
 
 // Copied from vlc
 static unsigned char* parseH264ConfigStr( char const* configStr,
@@ -137,6 +138,7 @@
 #ifdef CONFIG_LIBAVCODEC
     avcodec_register_all();
     h264parserctx = av_parser_init(CODEC_ID_H264);
+    avcctx = avcodec_alloc_context();
 #endif
     needVideoFrameRate(demuxer, subsession);
   } else if (strcmp(subsession->codecName(), "H261") == 0) {