From patchwork Wed Oct 5 12:38:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodger Combs X-Patchwork-Id: 888 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp295156vsd; Wed, 5 Oct 2016 05:38:45 -0700 (PDT) X-Received: by 10.194.17.197 with SMTP id q5mr7580546wjd.115.1475671125249; Wed, 05 Oct 2016 05:38:45 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id s195si1136758wmb.124.2016.10.05.05.38.44; Wed, 05 Oct 2016 05:38:45 -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; dkim=neutral (body hash did not verify) header.i=@gmail.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; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DE007689E4C; Wed, 5 Oct 2016 15:38:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it0-f65.google.com (mail-it0-f65.google.com [209.85.214.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 43962689E27 for ; Wed, 5 Oct 2016 15:38:13 +0300 (EEST) Received: by mail-it0-f65.google.com with SMTP id j69so11305065itb.1 for ; Wed, 05 Oct 2016 05:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=KBn04X2wBBpCeOKlF/XW3QnUmHaA2vU1PMjEz3pdf+Y=; b=qqMLiac/pBfX0Z5VxycnJPezF9tvmLaxj9HNPOkbDDeNVV+uSSUxNxJE564rYXqnaF 6/0WUzXfwxekeI9hniDorHG2ojhdTeHHqBgE20x1u6fB9oSiTz58XqCCY2nwNo00JAdl xc1EfFgpEoXNsUsBuIKSZVRxXV1czdLiAElnftSw4Y1QhiCHV/kgc/LpMsReVc8ZXwuZ jVefX1J0JXbIT8D5zHU7RXDb4Bj2o7FN0/yuyK5VEp/zyqOrnvzS8tszeuGc47DqVOGs fRx5gHLOSOJgIYQTB+ADP4zrwopx0wSDmf9WNgyYHtxXitz825m0AurvDpy53BMw6BAG l2gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=KBn04X2wBBpCeOKlF/XW3QnUmHaA2vU1PMjEz3pdf+Y=; b=ZRziP6EiOD32lyCq8MH2iEqRSHkSoTBV3ZAZRs1155Si8rJGEmLtV4RcQbdoOMUCrU uI/lRfqmfwCaGN2ZV1zU+ZLyAg2H14+11aGUxYFoz/zQwwy8rP13MM/L0Wa9//Q02/dZ y03CS+Kn7Rd4QkFbHuKuLd7DUgSdyNa/BO0M6BywY4gjZIiQNP0sqisd6aS9zfD+JZvY MRnctZxWRpW1pGDbuT/vMAY5+d0aXQXzPwLwmM6PASSO+jr7nWNUADiddBoJWsWPihXL N7zVCQ+v3piMxELM7wwPOtQiJsXlfkjv6RvgYbyEzOo79JSsfaH0NOuTb5Pn0r3VdzgT JLuw== X-Gm-Message-State: AA6/9RlVLRyuRPC1FAzyr1b5MDM5ca4qeFiAcNR5IcxpH1ophBPYVU2lJ9RFpk2IOhryxQ== X-Received: by 10.36.222.137 with SMTP id d131mr9121281itg.1.1475671107070; Wed, 05 Oct 2016 05:38:27 -0700 (PDT) Received: from Rodgers-MacBook-Pro.local.net (c-73-209-137-129.hsd1.il.comcast.net. [73.209.137.129]) by smtp.gmail.com with ESMTPSA id u6sm11557844itb.3.2016.10.05.05.38.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 05 Oct 2016 05:38:26 -0700 (PDT) From: Rodger Combs To: ffmpeg-devel@ffmpeg.org Date: Wed, 5 Oct 2016 07:38:22 -0500 Message-Id: <20161005123822.91705-2-rodger.combs@gmail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161005123822.91705-1-rodger.combs@gmail.com> References: <20161005123822.91705-1-rodger.combs@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] lavf/utils: avoid using programs for duration when there's only one 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This allows us to be more selective about the streams we derive durations from (specifically, ignoring text streams with outlier end times) in the common case --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index d19cc5e..1aa3b50 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2582,7 +2582,7 @@ static void update_stream_timings(AVFormatContext *ic) if (start_time != INT64_MAX) { ic->start_time = start_time; if (end_time != INT64_MIN) { - if (ic->nb_programs) { + if (ic->nb_programs > 1) { for (i = 0; i < ic->nb_programs; i++) { p = ic->programs[i]; if (p->start_time != AV_NOPTS_VALUE && p->end_time > p->start_time)