From patchwork Mon Dec 13 15:20:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 32438 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp5576377iog; Mon, 13 Dec 2021 07:25:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVaBVCsLfZEeCVgaGxJ4oLmQJGyoxB8jIJR2JQi/sdDWBWniFB6G3mDC/OuwODEb1PZ1lO X-Received: by 2002:aa7:c946:: with SMTP id h6mr66809768edt.190.1639409140072; Mon, 13 Dec 2021 07:25:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639409140; cv=none; d=google.com; s=arc-20160816; b=rFf8wu6iBdsb4qWQFPk2lEtwVZxUEyozvrIVT90ZJ7Cz7mdS5GhsRgkHC0CJjDpeWB x8AA6cgy9rK/zA6WeeYgWYPOfxOaaSTOrBEpFonokCG0fm1P+n4OMUIMUQG2cx1wnKAP QoGz4hEHjJ0GA3PL4gPdEOQkAClFdcRTEG1psF4I9JtSrG7BBf1IqdGFG4oOYTpNqN8a hr4QFLebgL5Oe7hMFCxUnR7SNBXYv2zI0E0pnl7eH9tT2DumVJGH7EjGVY7I99A9snyP +nkEWkL/oJgoOzCj2x4UVVJL3fQZoeobYQt0M4PhEjMPCrkim58PwWELcXesQ/Ny9JjQ 2hgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=fLCT9eUBnT84w43wNs8vY+yfOpDkZS2JxISrySThyAM=; b=xF2PpeeWWvTmuRiCdAvH2Hbi3oAxCEQEOkjnR4svfGHKAbNgRDigDjR2qTtno4jamf rTR1dQKUb1Je8zY82LjpvuxEr6hNLAWWbHBBJ0fWoSNUFszCBADy8sHIo8EkU6NiOxdk zCwePxpRk9CJc2CvoYzRPSw+METcf+b2r0Z1xyDQUYUPr+tzJ7uNi6CSMe+THTPSFLPw 9lXwVPDMO+X7NGqJM4XEKrh2tADt5HdNJa7WAojGVcFEHztTfL9z0lDKDyPRdfhTPpix PW3UjMqph2ka1kA3cnTyY2NzHOBh0M7pttPsefYdavcFKA4s7XdkTDf6eTs4IZNMcMs+ we1w== 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 kb24si15272302ejb.453.2021.12.13.07.25.39; Mon, 13 Dec 2021 07:25:40 -0800 (PST) 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 5CB7C68B024; Mon, 13 Dec 2021 17:22:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A11D868AFAD for ; Mon, 13 Dec 2021 17:22:19 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id C0B462405F5 for ; Mon, 13 Dec 2021 16:22:16 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id sAGY2OF23YSS for ; Mon, 13 Dec 2021 16:22:16 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 0320124068C for ; Mon, 13 Dec 2021 16:22:08 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 646F03A0631; Mon, 13 Dec 2021 16:22:07 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 Dec 2021 16:20:40 +0100 Message-Id: <20211213152042.5900-22-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211213152042.5900-1-anton@khirnov.net> References: <20211213152042.5900-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 22/24] ffmpeg: move a comment to a more appropriate place X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 8V4FPD6hf2ce --- fftools/ffmpeg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index bbedf867b4..538601e440 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1064,6 +1064,11 @@ static void do_video_out(OutputFile *of, } } + /* + * For video, number of frames in == number of packets out. + * But there may be reordering, so we can't throw away frames on encoder + * flush, we need to limit them here, before they go into encoder. + */ nb_frames = FFMIN(nb_frames, ost->max_frames - ost->frame_number); nb0_frames = FFMIN(nb0_frames, nb_frames); @@ -1217,11 +1222,6 @@ static void do_video_out(OutputFile *of, } } ost->sync_opts++; - /* - * For video, number of frames in == number of packets out. - * But there may be reordering, so we can't throw away frames on encoder - * flush, we need to limit them here, before they go into encoder. - */ ost->frame_number++; if (vstats_filename && frame_size)