]> git.sesse.net Git - ffmpeg/commitdiff
Don't mark generated dummy frame output from mpeg1/2 decoder as keyframe.
authorelupus <elupus@xbmc.org>
Fri, 22 Apr 2011 13:42:51 +0000 (15:42 +0200)
committerJoakim Plate <elupus@ecce.se>
Sat, 16 Jul 2011 10:38:25 +0000 (12:38 +0200)
We use this flag to tell when to assume decoded data is free
from artifacts after a seek. The mpeg1/2 decoder will generate
a dummy frame if decoding is started on a non keyframe. This
will sadly be output from decoder to player and displayed
as a gray screen.

libavcodec/mpegvideo.c

index d3540c961a10da2012978f64b269a142a7068d8b..3749fd9bd3c064918ab4fa0c6ae9210fe90c76ea 100644 (file)
@@ -1114,6 +1114,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
             /* Allocate a dummy frame */
             i= ff_find_unused_picture(s, 0);
             s->last_picture_ptr= &s->picture[i];
+            s->last_picture_ptr->key_frame = 0;
             if(ff_alloc_picture(s, s->last_picture_ptr, 0) < 0)
                 return -1;
             ff_thread_report_progress((AVFrame*)s->last_picture_ptr, INT_MAX, 0);
@@ -1123,6 +1124,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
             /* Allocate a dummy frame */
             i= ff_find_unused_picture(s, 0);
             s->next_picture_ptr= &s->picture[i];
+            s->next_picture_ptr->key_frame = 0;
             if(ff_alloc_picture(s, s->next_picture_ptr, 0) < 0)
                 return -1;
             ff_thread_report_progress((AVFrame*)s->next_picture_ptr, INT_MAX, 0);