From patchwork Mon Dec 24 19:52:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 11539 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id BB58644D7BF for ; Mon, 24 Dec 2018 21:52:53 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7039868AD13; Mon, 24 Dec 2018 21:52:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6059068A9D0 for ; Mon, 24 Dec 2018 21:52:44 +0200 (EET) Received: by mail-wr1-f65.google.com with SMTP id 96so12364514wrb.2 for ; Mon, 24 Dec 2018 11:52:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=YuzZpfF6P81Fa8oCW0aUvs/YLS4T24mZv0ieFk8YHS4=; b=trKEaO+wMSjYyblkZro8GwYaS7k72/RLXjQlyCr6wwRDuArt91uaUAGS8KqIAB1AXu gHUQU8DdONGh5PoOs3LuX2aFP9wiXrLQ0a4HGHGivl1UcTVPZh7egcN3mmeOLIlkJyL0 yjw51h3Aoq0+mjH7KAXA7vIdDml4W9+8J96ywWS1fBLwiRmPJEaABg5B41Axo+1bWynz CwtvixjEWAP7q5Uf8e7WCI26Yzrv+9HkLnXSpVTkr81HJzd1i5rkpjbFxRyruyEYf4E9 1Df0wKm+qs9AxUDeenRmqbAJjy4oacK/9TI05NrSwGmg2gdS6Rp+YDObtHm+pZZ0B7C+ utVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=YuzZpfF6P81Fa8oCW0aUvs/YLS4T24mZv0ieFk8YHS4=; b=IeVrE+H2ubPTY70nu0P1sbLikPnazTdPtxBAZdsgEx/7w2BdF5GGFmcnk76/ueotWP mEdtT7z0V8AS/6yb2K80jGHTrCZCmgMsDn+7R4/eLxnzPyAsAfo4bf3h/j75aR1N3kLw 84TLUNiZk1XFomgoeifx+6D0ZhyZFS1UgPEjSefBeqW5oqewuAoaiKsq4tQjm8+6yb0g Gl3rRTed/ZyBXxv/19MUe6Dm3rw0yhp+JNEIj7JOlcoUp226QMekE1RBFGcYS7JuyTEz jr7fo7fac84nWVLUJNh7q2Tpyt0P0SdxG6Kk2xZWUXtHjWU6q2H5ua1AADIY7YvVrQxW bzaQ== X-Gm-Message-State: AJcUukczYzjY9y+SoWIsZRCZMgo6ygloQQwowIKi3hkAJtQTfJua+CC8 r95EiEAalXAAQaNDlS9KPq623/YU X-Google-Smtp-Source: ALg8bN4ssOoxWqzIKXRYoIaenntXOlr89dhVDdlWpjCJ1WCLoTHtixjCJTT59zDk+ZkAXtjn/1zxbw== X-Received: by 2002:a5d:660e:: with SMTP id n14mr12681519wru.19.1545681168270; Mon, 24 Dec 2018 11:52:48 -0800 (PST) Received: from localhost.localdomain ([81.2.170.96]) by smtp.gmail.com with ESMTPSA id n20sm13488323wmi.11.2018.12.24.11.52.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Dec 2018 11:52:47 -0800 (PST) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Dec 2018 19:52:34 +0000 Message-Id: <20181224195234.15161-1-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] mov: Remove duration-of-last-frame heuristic hack 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" This breaks totally valid files that get caught in its heuristic. This, according to the commit message, is my own doing, having asked Michael to implement this check and providing a sample that was "wrong". I am now atoning for my sins, and removing this hack, having seen the light (aka that this was silly to do in the first place). Resotores correct behavior on valid files. This reverts commit 8e5e84c2a2a21a979b48e80c5a8dd44754ab3f21. Signed-off-by: Derek Buitenhuis --- libavformat/mov.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 825738127b..0f1b6bf475 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2923,13 +2923,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_log(c->fc, AV_LOG_TRACE, "sample_count=%d, sample_duration=%d\n", sample_count, sample_duration); - if ( i+1 == entries - && i - && sample_count == 1 - && total_sample_count > 100 - && sample_duration/10 > duration / total_sample_count) - sample_duration = duration / total_sample_count; - duration+=(int64_t)sample_duration*(uint64_t)sample_count; + duration+=(int64_t)sample_duration*sample_count; total_sample_count+=sample_count; }