From patchwork Mon Apr 4 11:29:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 35158 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp1911486pzb; Mon, 4 Apr 2022 04:32:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKmXJks1xyPwq/NAVEXYM6OAI6haiccnXzgGA39ELcEyZLH8TNWGHbTEvs7sE8y+CsfFzo X-Received: by 2002:a17:906:a2c2:b0:6e7:efc2:17f2 with SMTP id by2-20020a170906a2c200b006e7efc217f2mr3706130ejb.542.1649071959863; Mon, 04 Apr 2022 04:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649071959; cv=none; d=google.com; s=arc-20160816; b=lJmgAO9kh7sn37eyHxj/ZiW0h9QYmHCZ0UIunhDUXlDJF74xagrtByaUutwE4l0Rsb e0Mfa5uxZWbXDq80gPISH0mBeQZpwuJp96c3nLrSYZevNP3bwRksz1tEgHmcDp7u7unc GsonXir0m65ebExbNVhdSkiOclkMIZ6JEFr/yHliheC8sysCMEEHziSLvLp3izfy9ssM Vgj9qoeDHvGFiTY9pMbv2iM5A9ZZgagW22MIKJyjthD6oqYihi9f6UZh/t72chRoBjaL WtmbC7gs2NXfoz2Xk2FOURc4P6BJjkh6Oe5SCPg4R6KHVXMzpf+kskg9BkahLPnTFqoy PkDA== 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=SSyFQtTbgawKs68w8hTQOMi+AjyUtsAKoqosFFNE8yk=; b=gPX+K+WLtFN9k2FnGd+/vp+JfKHdAa63PNgxr4Tsu2bPXrelhquwE8kS/OQHXFncbY rHJdEsFRQ6Oav/aZ3UFU0A/mtHCK3QnwzxHd1N9hVOnVRjaMQQh8l5Z6tiT4PQDqYsIc m64vQ+2UaxCpmh2pCwUgySZigenCwyJH+dUf6xx32zhReub1m5Y0pramR2z7jXBk1ZC5 ExwkEdY7uHhv4pVFKtBrm/04HqbLwQYAWoc+E926UwS6OLb6WT8wokx8B958F0KRaRt6 L33sHurtalcaYyDxd9ZEOWNy7EpiKo3UQ0TuxUEffzLAWjUg1+gtTnEXLqBlvNf3+V+W cudg== 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 og12-20020a1709071dcc00b006e00eb3a62bsi5541433ejc.101.2022.04.04.04.32.39; Mon, 04 Apr 2022 04:32:39 -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 4642D68B20C; Mon, 4 Apr 2022 14:32:24 +0300 (EEST) 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 E718D68AEFE for ; Mon, 4 Apr 2022 14:32:16 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 0D85D240694 for ; Mon, 4 Apr 2022 13:32:16 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id IVqfeAx_juM9 for ; Mon, 4 Apr 2022 13:32:14 +0200 (CEST) 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 9CB13240179 for ; Mon, 4 Apr 2022 13:32:14 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 9FF893A0663; Mon, 4 Apr 2022 13:32:11 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 4 Apr 2022 13:29:50 +0200 Message-Id: <20220404113037.13070-3-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220404113037.13070-1-anton@khirnov.net> References: <20220404113037.13070-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/49] fftools/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: 5Dh90+WWr8Cb --- fftools/ffmpeg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index afa1b012a6..13be32f0cf 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1238,6 +1238,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); @@ -1392,11 +1397,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)