---
 libavcodec/mpeg12.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index f566a27..e7af768 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1235,16 +1235,15 @@ static int mpeg_decode_update_context(AVCodecContext *avctx, AVCodecContext *avc
     Mpeg1Context *ctx = avctx->priv_data, *ctx_from = avctx_from->priv_data;
     MpegEncContext *s = &ctx->mpeg_enc_ctx, *s1 = &ctx_from->mpeg_enc_ctx;
 
+    if (!ctx_from->mpeg_enc_ctx_allocated || !s1->context_initialized)
+        return 0;
+
+    ff_mpeg_update_context(avctx, avctx_from);
+
     if (!ctx->mpeg_enc_ctx_allocated) {
-        memcpy(ctx, ctx_from, sizeof(Mpeg1Context));
-        s->avctx = avctx;
-        s->picture_range_start += MAX_PICTURE_COUNT;
-        s->picture_range_end += MAX_PICTURE_COUNT;
-        MPV_common_init(s);
+        memcpy(s + 1, s1 + 1, sizeof(Mpeg1Context) - sizeof(MpegEncContext));
     }
 
-    MPV_update_picture_pointers(s, s1);
-
     if (!(s->pict_type == FF_B_TYPE || s->low_delay))
         s->picture_number++;
 
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to