From 9c483feffdc5059e17d8236d78416dae677d5551 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 30 Apr 2025 18:42:43 +0200 Subject: [PATCH 39/44] avcodec/mpeg12dec: Reinit upon chroma_format change Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg12dec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 3f387de0fd..a06cacb87a 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -80,7 +80,7 @@ typedef struct Mpeg1Context { int has_afd; int slice_count; unsigned aspect_ratio_info; - int save_width, save_height, save_progressive_seq; + int save_width, save_height, save_progressive_seq, save_chroma_format; AVRational frame_rate_ext; /* MPEG-2 specific framerate modificator */ unsigned frame_rate_index; int sync; /* Did we reach a sync point like a GOP/SEQ/KEYFrame? */ @@ -917,6 +917,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) avctx->coded_height != s->height || s1->save_width != s->width || s1->save_height != s->height || + s1->save_chroma_format != s->chroma_format || (s1->save_progressive_seq != s->progressive_sequence && FFALIGN(s->height, 16) != FFALIGN(s->height, 32)) || 0) { if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s1->bit_rate && @@ -960,6 +961,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) s1->save_width = s->width; s1->save_height = s->height; s1->save_progressive_seq = s->progressive_sequence; + s1->save_chroma_format = s->chroma_format; if (!s->avctx->lowres) for (int i = 0; i < s->slice_context_count; i++) -- 2.45.2