Commit fd7cb864 authored by Zhong Li's avatar Zhong Li Committed by Michael Niedermayer

mpegdec: fix redundant dummy frames issue of interlaced clips

It is to fix https://trac.ffmpeg.org/ticket/6677. Actucally it is a
regression of commit 99e07a44 which
always inserts a dummy frame when decode the first key field picture.
Signed-off-by: 's avatarZhong Li <zhong.li@intel.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 93d27e02
...@@ -1283,8 +1283,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) ...@@ -1283,8 +1283,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
s->pict_type, s->droppable); s->pict_type, s->droppable);
if ((!s->last_picture_ptr || !s->last_picture_ptr->f->buf[0]) && if ((!s->last_picture_ptr || !s->last_picture_ptr->f->buf[0]) &&
(s->pict_type != AV_PICTURE_TYPE_I || (s->pict_type != AV_PICTURE_TYPE_I)) {
s->picture_structure != PICT_FRAME)) {
int h_chroma_shift, v_chroma_shift; int h_chroma_shift, v_chroma_shift;
av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
&h_chroma_shift, &v_chroma_shift); &h_chroma_shift, &v_chroma_shift);
...@@ -1294,9 +1293,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) ...@@ -1294,9 +1293,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
else if (s->pict_type != AV_PICTURE_TYPE_I) else if (s->pict_type != AV_PICTURE_TYPE_I)
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"warning: first frame is no keyframe\n"); "warning: first frame is no keyframe\n");
else if (s->picture_structure != PICT_FRAME)
av_log(avctx, AV_LOG_DEBUG,
"allocate dummy last picture for field based first keyframe\n");
/* Allocate a dummy frame */ /* Allocate a dummy frame */
i = ff_find_unused_picture(s->avctx, s->picture, 0); i = ff_find_unused_picture(s->avctx, s->picture, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment