[FFmpeg-devel] [PATCH] oggparsetheora: set need_context_update when changing codec id

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Fri Nov 4 23:27:23 EET 2016


Otherwise the codec context and codecpar might disagree on the codec id,
triggering asserts in av_parser_parse2.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
---
 libavformat/oggparsetheora.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c
index b14f9f0..078d827 100644
--- a/libavformat/oggparsetheora.c
+++ b/libavformat/oggparsetheora.c
@@ -111,6 +111,8 @@ static int theora_header(AVFormatContext *s, int idx)
         thp->gpmask  = (1U << thp->gpshift) - 1;
 
         st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+        if (st->codecpar->codec_id != AV_CODEC_ID_THEORA)
+            st->internal->need_context_update = 1;
         st->codecpar->codec_id   = AV_CODEC_ID_THEORA;
         st->need_parsing      = AVSTREAM_PARSE_HEADERS;
     }
-- 
2.10.1


More information about the ffmpeg-devel mailing list