From patchwork Wed Oct 12 19:57:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 977 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp22177vsd; Wed, 12 Oct 2016 12:57:31 -0700 (PDT) X-Received: by 10.194.87.170 with SMTP id az10mr3834995wjb.189.1476302251086; Wed, 12 Oct 2016 12:57:31 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qo3si12336960wjc.266.2016.10.12.12.57.30; Wed, 12 Oct 2016 12:57:31 -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; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org; 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 44CE0689887; Wed, 12 Oct 2016 22:57:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from btbn.de (btbn.de [5.9.118.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C63ED6897C0 for ; Wed, 12 Oct 2016 22:57:21 +0300 (EEST) Received: from localhost.localdomain (ip4d173c0b.dynamic.kabel-deutschland.de [77.23.60.11]) by btbn.de (Postfix) with ESMTPSA id E0ED84CFFD; Wed, 12 Oct 2016 21:57:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rothenpieler.org; s=mail; t=1476302242; bh=f8fj3rzSigiqmKXez0ZeDCYmUDG7EYlRwEXReSA9K5Q=; h=From:To:Cc:Subject:Date; b=d/7WP49DtS3zMtZXl+O30ic6enn1lUBQmUt4cmZWeIoGQKXYR45RU5uvYmxvbU3Ah aEuQ63fMMdTDAZAs94nxYWK5fA/WHfc9e36H14H2nJsxlSlwO1P6zH1uhBhe/j/O8j 1lQDN1x1vASqSgechOofnxrui8f/+X5y9Las8fsA= From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Oct 2016 21:57:16 +0200 Message-Id: <20161012195716.11304-1-timo@rothenpieler.org> X-Mailer: git-send-email 2.10.1 Subject: [FFmpeg-devel] [PATCH] avcodec/libx264: fix forced_idr logic 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: Timo Rothenpieler MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Currently, it forces IDR frames for both true and false. Not entirely sure what the original idea behind the tri-state bool option is. --- libavcodec/libx264.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 9e12464..32e767e 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -293,8 +293,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, switch (frame->pict_type) { case AV_PICTURE_TYPE_I: - x4->pic.i_type = x4->forced_idr >= 0 ? X264_TYPE_IDR - : X264_TYPE_KEYFRAME; + x4->pic.i_type = x4->forced_idr > 0 ? X264_TYPE_IDR + : X264_TYPE_KEYFRAME; break; case AV_PICTURE_TYPE_P: x4->pic.i_type = X264_TYPE_P;