From patchwork Tue Jan 11 09:58:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 33215 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp3546117iog; Tue, 11 Jan 2022 02:01:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdgd/P8XwDRbfQZAu5aOYUGHZLt0wAIAHzv7z9U/KqsXrZId4hnhxio8b2PWSDbQyeqjhq X-Received: by 2002:a17:907:9804:: with SMTP id ji4mr2923259ejc.417.1641895270584; Tue, 11 Jan 2022 02:01:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641895270; cv=none; d=google.com; s=arc-20160816; b=kiFrHPYt4noYyjpNrpRlm4Lv26E28q3Vioh7K2+nLDbK636pDvpMIRoRhV84btPS+Y zgcgT1v5HvjrGNaFWmjie8TQqeSwsYHsR4k+XG8USVKQYEM+3I+yhOeVGocIa9M+RglX iF+KSpnSp1USldD/dIk85u8X8xNelY465hGDwKAgEpgBzYxVBUK6efYWcfY2CoBG3B0L 6uscBNH9HxfUo/pv6rcmRPTdx32q+IrClse376NXEW+32goTtxBs2LgHxEQSH1w33eb5 +lXsWFT77gB++0f/QkMRdLcdyVwsRB3qFvba8Rkd1YWREQHhLch2yshL6arZuZwkXovz Qoxw== 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=C3WLt7Ql/uwq6v0RwgGifdWtJxUsn9ttNDNOSosEr48=; b=P9UW674Vd2SHQnOT36q+2zD0ZnnBJtmJIAamGxXjWQtK7pMv5MDgShgbnVVIgOcZb3 JcJn2E9L7RmYXduksdC6n1lp9O/bRUkU5ARczQAQ26pz7NMrhYSG4b5P9SrqpjyIensA 2NROdT7+hLcat5wDA/fzIX2vRQo9eS6/f/80JKmq6aUgmnDP7t3+8x6/58dftI8zqgbe CcDnr7y3Z8gpFSUbhBgO7kRyMpkJjQS5EhmNIN3jaKVaJe4y4+HN04HpBHsdIqXbzqxG 038a3iY6aQeNuumIFbE+HjEMeSs24JJZ3gclaMOLOiTMJe9h2vtkNVJAN6oYD2ShJ8o5 7VnQ== 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 sc11si407123ejc.65.2022.01.11.02.01.09; Tue, 11 Jan 2022 02:01:10 -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 B963F68AF2A; Tue, 11 Jan 2022 11:59:21 +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 ABC1A68AF4C for ; Tue, 11 Jan 2022 11:59:14 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 5F3A824017E for ; Tue, 11 Jan 2022 10:59:09 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id ls2i_bQSgNNc for ; Tue, 11 Jan 2022 10:59:08 +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 CAFF12405F0 for ; Tue, 11 Jan 2022 10:59:02 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 2E7303A0C0A; Tue, 11 Jan 2022 10:59:02 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 11 Jan 2022 10:58:23 +0100 Message-Id: <20220111095830.31542-21-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220111095830.31542-1-anton@khirnov.net> References: <20220111095830.31542-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 21/28] 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: IQLvkKIxdYaT --- fftools/ffmpeg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 4215be0098..f39b1b9375 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)