From patchwork Sat Nov 26 08:19:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 39462 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp6013648pzb; Sat, 26 Nov 2022 00:21:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf5tcW0B5Vn3rwt6DtWQBk5fA+MJU3/1grSeQE50IGp9zj8Ee/48Mw1vBwE8NtAOhA0YdFof X-Received: by 2002:a05:6402:4027:b0:468:fc39:e89 with SMTP id d39-20020a056402402700b00468fc390e89mr22356032eda.170.1669450880377; Sat, 26 Nov 2022 00:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669450880; cv=none; d=google.com; s=arc-20160816; b=wF4GITHxRXLfLnpt6vABM71Idm8tZQKrT3Eleym7l1M+fFAtuOzLmOR599bC7PGDhU vrnC98yLG5oiaL6TCa6WKv2ol+yNGTSMhQ8RGXkMNVGPFhsn69rmn7pmpYcVj/bgNtvS VDwhj7nq6BHOWsUhjNUih7hyQ/7GrvuuspqhARopiG1Nlar7GX7BccvJUDcfRFBQtld+ 85yfDKLQSIqYfZ9qTTiU8CmrwmFBurXNlBFj+Dq33tL+0xR8ToJxWkmS4CVxrNVLXCb/ AT/8EUkDx4BW/fWvCQ/4P/aOv+1vDEwCYDYl5m3FtzAbgZRmwJYwm5mAanhVVol2gcxO vY0g== 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=vBdQ7nv5lcxOn2qo4X7ZWkj420UhDj3stlkvRiqmOlY=; b=Nsm1YgZx5oYRibuxqmJJAm2cmn6ux4QlwxTeHR+7ELoiS3YxJj1tjgL9jbC3HfU9qT cqPIT7VXTJEH+zBj6NTt6zBz1Qsip4/ahFWsLTnXn1cFfp2lwcCxoOglTUbAV9BogZD3 3VQlqh4jRWXJ0pHaf2gUgfR24Ne/XXFcuQQ6hBvCHGAooCJRh2/lccqUOrve4Tqunwqn wRYhEtZqwHT/CA+dtK/wPrv2rB+ZLlviDOGrUDLifju4mY120g+6f/UV+Pbh8QyOCVxX TRSp5Unw/85cdYSBIuCu+SsCOyQq9PluzY8O1ibYy2eGm/Vgdyk2gyoYO4sCkWPocC8p lgzw== 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 k26-20020a056402049a00b0045d9a3adf48si5131741edv.591.2022.11.26.00.21.20; Sat, 26 Nov 2022 00:21:20 -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 3200768BA9D; Sat, 26 Nov 2022 10:19:43 +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 8702468B937 for ; Sat, 26 Nov 2022 10:19:30 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 80E5B2406CC for ; Sat, 26 Nov 2022 09:19:28 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id k08FB261PEOd for ; Sat, 26 Nov 2022 09:19:28 +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 E16D12406CE for ; Sat, 26 Nov 2022 09:19:23 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id D3E1C3A040A for ; Sat, 26 Nov 2022 09:19:23 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 26 Nov 2022 09:19:11 +0100 Message-Id: <20221126081911.31275-13-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221126081911.31275-1-anton@khirnov.net> References: <20221126081911.31275-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/13] fftools/ffmpeg: cosmetics 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: 0PRBWFNgwPSM Reindent after previous commit and break/split some lines as appropriate. --- fftools/ffmpeg.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 045cc609b9..771219f7df 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -688,18 +688,17 @@ static double adjust_frame_pts_to_encoder_tb(OutputFile *of, OutputStream *ost, if (frame->pts == AV_NOPTS_VALUE) goto early_exit; - tb.den <<= extra_bits; - float_pts = - av_rescale_q(frame->pts, filter_tb, tb) - - av_rescale_q(start_time, AV_TIME_BASE_Q, tb); - float_pts /= 1 << extra_bits; - // avoid exact midoints to reduce the chance of rounding differences, this can be removed in case the fps code is changed to work with integers - float_pts += FFSIGN(float_pts) * 1.0 / (1<<17); - - frame->pts = - av_rescale_q(frame->pts, filter_tb, enc->time_base) - - av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base); - frame->time_base = enc->time_base; + tb.den <<= extra_bits; + float_pts = av_rescale_q(frame->pts, filter_tb, tb) - + av_rescale_q(start_time, AV_TIME_BASE_Q, tb); + float_pts /= 1 << extra_bits; + // avoid exact midoints to reduce the chance of rounding differences, this + // can be removed in case the fps code is changed to work with integers + float_pts += FFSIGN(float_pts) * 1.0 / (1<<17); + + frame->pts = av_rescale_q(frame->pts, filter_tb, enc->time_base) - + av_rescale_q(start_time, AV_TIME_BASE_Q, enc->time_base); + frame->time_base = enc->time_base; early_exit: