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

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Wed Nov 23 00:18:19 EET 2016


On 04.11.2016 22:27, Andreas Cadhalpun wrote:
> 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;
>      }
> 

Ping. I intend to apply this in a few days.

Best regards,
Andreas


More information about the ffmpeg-devel mailing list