Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2014-12-02 16:44:36 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2017-08-04 20:16:46 +0300
commite0e6d160fca589163e4f9f1e6385117ae8c8cd51 (patch)
treeb1e28dbc7ba03e125b282db75d7e58196b75bd59
parent9ce7cba2e6d4aaa6286b9f8e1015d2eab6c28d91 (diff)
mpeg12dec: properly handle a codec_id change
-rw-r--r--libavcodec/mpeg12dec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 8651580957..f99b9cb5e9 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -64,6 +64,7 @@ typedef struct Mpeg1Context {
int slice_count;
AVRational save_aspect;
int save_width, save_height, save_progressive_seq;
+ enum AVCodecID save_codec_id;
AVRational frame_rate_ext; /* MPEG-2 specific framerate modificator */
int sync; /* Did we reach a sync point like a GOP/SEQ/KEYFrame? */
int tmpgexs;
@@ -1295,6 +1296,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
s1->save_height != s->height ||
av_cmp_q(s1->save_aspect, s->avctx->sample_aspect_ratio) ||
(s1->save_progressive_seq != s->progressive_sequence && FFALIGN(s->height, 16) != FFALIGN(s->height, 32)) ||
+ s1->save_codec_id != s->codec_id ||
0) {
if (s1->mpeg_enc_ctx_allocated) {
ParseContext pc = s->parse_context;
@@ -1318,6 +1320,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_codec_id = s->codec_id;
/* low_delay may be forced, in this case we will have B-frames
* that behave like P-frames. */
@@ -2239,6 +2242,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
s1->save_width = s->width;
s1->save_height = s->height;
s1->save_progressive_seq = s->progressive_sequence;
+ s1->save_codec_id = s->codec_id;
return 0;
}