From patchwork Sat Sep 30 03:22:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 5348 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.61.197 with SMTP id n188csp1480230jan; Fri, 29 Sep 2017 20:27:54 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBCfuCCqgtKLfpKczE9ukQ3P3Zwrz6bi2qeF7yZvpPx8ShrMmxC6nS/bH67JUvwm+UfhC0d X-Received: by 10.223.135.97 with SMTP id 30mr8349584wrz.245.1506742073920; Fri, 29 Sep 2017 20:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506742073; cv=none; d=google.com; s=arc-20160816; b=z3gPAxKYqqbScPbPJb/fyLKBSTNIDkuSFiyGfhSujFE7sto1rkukF35F2/329uNO00 Mmf1aZ6QZUZJhRO/bGLEA+xMAyKfddbshaIAovpUAvaSRDBSuENxB7r+wYed9+E9W3qT Z3xE6Pb2LCsnMA3rlVDJTsHDxrPyLJdTpmt3AXM9+xkpwY3seTID7iEan0sVZuM4KeGm T6iaYBsq39Vsf5IniZpOKMvGUfiteb0A5qfPZlmW7iyjAU0pGxkgxXNmpA14vCv5NdKO 3bdscHS1UYmeQ6t5pl+AArfSsFydiq+FJwgONzULkZy9LNq4AFVJ97+L7vdg05sMP7/B tYOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=OpUSEUStiPYq53Hj/BU+e6BSfy/Imdc3ZuCP1qPAfnU=; b=dh4Oiol6p07i8ftifcHWPo+whvCcKpEWyTjkVlzDv3HD6N0GFUgUBww8biXoheBABi tKd3LXU2g9O5DpyuN48Gac23mWaJ5m6BjU16NRNbJyel0lB59xVZ2YNvhTJSo2DxK1fN AcDijDpF2WOkMs0CIIjWVkz7HM4WjXkaNDzCVLmoLekcLRgqyKT08iI9slacGxchJuVg ciIfxMifoIZoJyd2cmfPHPFXGcvp6HVGRCWl8X9Gfqf6YVKm0djujW1zJfswu0CxRQWl bfahx9sn4yu5gR+OkTL733IeZMz46eAPot5wyxsMRfHUxAXWIq8bg6Fx6kwgiqlsadhW eFaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t14si4697777wra.64.2017.09.29.20.27.52; Fri, 29 Sep 2017 20:27:53 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5548B680A27; Sat, 30 Sep 2017 06:27:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DBD5A680596 for ; Sat, 30 Sep 2017 06:27:30 +0300 (EEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Sep 2017 20:27:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,455,1500966000"; d="scan'208";a="157760031" Received: from bluekbl.sh.intel.com (HELO localhost.localdomain) ([10.239.159.160]) by fmsmga006.fm.intel.com with ESMTP; 29 Sep 2017 20:27:39 -0700 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Sat, 30 Sep 2017 11:22:57 +0800 Message-Id: <20170930032257.14867-1-zhong.li@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] mpegdec: fix redundant dummy frames issue of interlaced clips X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zhong Li , sw@jkqxz.net, jun.zhao@intel.com, nfxjfg@googlemail.com MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" It is to fix https://trac.ffmpeg.org/ticket/6677. Actucally it is a regression of commit 99e07a4453732058df90885f80b3db3b4f37cb3c which always inserts a dummy frame when decode the first key field picture. Signed-off-by: Zhong Li --- libavcodec/mpegvideo.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 82b94253ae..c4089972f0 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1283,8 +1283,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) s->pict_type, s->droppable); if ((!s->last_picture_ptr || !s->last_picture_ptr->f->buf[0]) && - (s->pict_type != AV_PICTURE_TYPE_I || - s->picture_structure != PICT_FRAME)) { + (s->pict_type != AV_PICTURE_TYPE_I)) { int h_chroma_shift, v_chroma_shift; av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift); @@ -1294,9 +1293,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx) else if (s->pict_type != AV_PICTURE_TYPE_I) av_log(avctx, AV_LOG_ERROR, "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 */ i = ff_find_unused_picture(s->avctx, s->picture, 0);