From patchwork Sun Oct 29 14:09:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_Gro=C3=9Fe?= X-Patchwork-Id: 5742 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp1615275jah; Sun, 29 Oct 2017 07:09:23 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RUonKeFx6TplXAx+cFMuM6LUYM/LFJDoZt3NukS5SP1fEVzesJhJTENnd8qoZ4fDegWJ9/ X-Received: by 10.223.188.147 with SMTP id g19mr5524034wrh.250.1509286163554; Sun, 29 Oct 2017 07:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509286163; cv=none; d=google.com; s=arc-20160816; b=LCz0aqKi6Aq4ugCzsU84UQKZrViO8u4lFlMxO2bvncQXQzud0Jf1GPYquU10dO7+0K Jz8jzwecm1hu/BWkT5fDGqngKKMKH+a0+2zyCIeSut8e5cyIXR5is72QapOCftBcgtGa HYezN/XyKv5jJNVuOpqLWTfeEAzjQrgJsRTTKIBqE9ol3WviaCgG05zPRRLTQLMwxM2B U4X7/GkbeBjtT8VDkU+SWJOD/tkUDTxQ8F99rpZjbB5x1cRmn2sYXKvSq/sdgRrgOebA RF7K4jqXekw81y0cfx6w/alWnLBC9FrBFOjDQkKnh/mT5oTyNqcspqw2TBWYlO8tRXge /53A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:to:from:date :delivered-to:arc-authentication-results; bh=sErdbkznQj5EHdWJcSU7MsXWG/syS+/zrXIVrXyyoto=; b=Mf26LPuHUHTclJfZ1iYxaQ5ywIqTSUbOjrYD8jVNGLyOQOlFU2yD5LEqpN+Bo50cAJ LaRxtU4ApCrre2nIklSMfUWiUz2G623LxF3NwlbDCUuCZbv3q/483Yr5uhIPog4M4OXI jxlZbAQ0JNJAvVUhIoaHNXf6qvi/bOHiDP8roLnHv5Noy8iYb9rKMzu3upT9aiF50cJM XT4HigAxOuPR39CUjAPmGdUiaO3teJhXfb6lMcXd5/rjSNkxvOz8j/S+HvH3DlxvHmMw gvn2twzX0UvQQNDIeP2Z5sLl+FE743Bq1QYrR/Jumt1aBjN4UrPTK41IopiGJo+x9Nfr UG/A== 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 g68si1344176wmc.138.2017.10.29.07.09.23; Sun, 29 Oct 2017 07:09:23 -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 2E2DC689F68; Sun, 29 Oct 2017 16:09:13 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from james.theweblords.de (james.theweblords.de [217.11.55.87]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7020F689F4E for ; Sun, 29 Oct 2017 16:09:07 +0200 (EET) Received: (qmail 6017 invoked by uid 210); 29 Oct 2017 14:09:16 -0000 X-Qmail-Scanner-Diagnostics: from x4d07d30c.dyn.telefonica.de (petronios@theweblords.de@x4d07d30c.dyn.telefonica.de) by james (envelope-from , uid 201) with qmail-scanner-2.10st (mhr: 1.0. spamassassin: 3.4.1. perlscan: 2.10st. Clear:RC:1(77.7.211.12):. Processed in 0.178587 secs); 29 Oct 2017 14:09:16 -0000 Received: from x4d07d30c.dyn.telefonica.de (HELO localhost) (petronios@theweblords.de@77.7.211.12) by james.theweblords.de with ESMTPA; 29 Oct 2017 14:09:15 -0000 Date: Sun, 29 Oct 2017 15:09:13 +0100 From: Peter =?UTF-8?B?R3Jvw59l?= To: ffmpeg-devel@ffmpeg.org Message-ID: <20171029150913.13e6b3a0@friiks.de> In-Reply-To: <20171029135620.GD20509@sunshine.barsnick.net> References: <20171029110805.8193-1-pegro@friiks.de> <20171029135620.GD20509@sunshine.barsnick.net> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] ffmpeg.c: fix calculation of input file duration in seek_to_start() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On Sun, 29 Oct 2017 14:56:20 +0100 Moritz Barsnick wrote: > On Sun, Oct 29, 2017 at 12:08:05 +0100, Peter Große wrote: > > } else duration = 1; > > For style/readability, the statement should be on a new line, perhaps > even with brackets. (Not necessarily as part of this patch though.) Sure. Regards Peter From 14032f4185a0824b819b062068f5777a33057ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Gro=C3=9Fe?= Date: Sun, 29 Oct 2017 15:07:12 +0100 Subject: [PATCH] ffmpeg.c: fix code style in seek_to_start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To: ffmpeg-devel@ffmpeg.org Signed-off-by: Peter Große --- fftools/ffmpeg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 17b594bac8..1e43b959da 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -4140,14 +4140,17 @@ static int seek_to_start(InputFile *ifile, AVFormatContext *is) AVRational sample_rate = {1, avctx->sample_rate}; duration = av_rescale_q(ist->nb_samples, sample_rate, ist->st->time_base); - } else + } else { continue; + } } else { if (ist->framerate.num) { duration = av_rescale_q(1, av_inv_q(ist->framerate), ist->st->time_base); } else if (ist->st->avg_frame_rate.num) { duration = av_rescale_q(1, av_inv_q(ist->st->avg_frame_rate), ist->st->time_base); - } else duration = 1; + } else { + duration = 1; + } } if (!ifile->duration) ifile->time_base = ist->st->time_base; -- 2.13.6