From patchwork Mon Dec 24 19:55:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 11540 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 B03F144E2D1 for ; Mon, 24 Dec 2018 21:55:17 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6612E68AA3D; Mon, 24 Dec 2018 21:55:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 647C968AD54 for ; Mon, 24 Dec 2018 21:55:07 +0200 (EET) Received: by mail-wr1-f68.google.com with SMTP id c14so12373227wrr.0 for ; Mon, 24 Dec 2018 11:55:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Xwnmils7V96IuCr5Mfdd8CzIPAj4VdRwyufhpgULZkw=; b=s2uedxQEYwhWsC1X0r/pJ6u859psdWFxjZF0Iz7Oa6ahdQGySF2MxYscd2TjHUn6jl 2VggzSXXwvwPRgMBaE/WzEkWzz8/wKFehXcdlxyqQTPi208AZdZXUtAM4dgV0NjC5GFG DoKetoJtP9MFR4aNr1laERsxC3CzlIVtY5YhCFr04xMREdk5eS0IyihaggKsmAwPfptc iznK+K9eB4kXo6wiWfRCjRTIEW1cii1OxrY7LWogcdmZumGN+wrsI1lbrLtgi4PgKpoa LElPaj432gtZ9QcUcI0nRtFgT5smJmNPBC7dQn82npLbSXEEi75N2DqwOlcR7y01yYbs 8qVw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Xwnmils7V96IuCr5Mfdd8CzIPAj4VdRwyufhpgULZkw=; b=gyyyGHMpTd0sN/hDdXwxyRKDbJqeyLjPwMZG7exc1ADtARSU8xOl+iWDFlgZvBoseJ Go2HxQmIPEOhh7fVME8ykHPhAubWABRl+98hsRdQwPN7xookU+Dm++H3w0QYoMaMKqI+ uXcf0TvTJqUPHuUsosKigpPIOJ+blL0YrRvGPypz79l5nFj8ayJ4K0nazm9xGn2Jmzsv ugqEd1/yhxD7GunddOZo2KGuIu7c5q9rSTXRJqyiZWrSW039JnGbQ0dJJ5CaTPl6nCD7 wCHsGPNnNPwmZS1jLyVnXx3SsCSnmm4dMll4bFtbozIPIptoFzpJq9HnqB2nmCNfSXqM mMag== X-Gm-Message-State: AJcUukfWEP/q59X7gms8VigEC7rXEKa8W5fipYVP43x5OY9DxInafR2C GKpjOsfdKAOsnRJvFvVZVby9QEnj X-Google-Smtp-Source: ALg8bN4YgSrTlKQHUYCy2uRVBO7nSmeciEewKz1FnNWl8g5/wNkO2l29lWTW2B63fSolCbtxUEfU+Q== X-Received: by 2002:adf:ed92:: with SMTP id c18mr13105480wro.194.1545681311342; Mon, 24 Dec 2018 11:55:11 -0800 (PST) Received: from localhost.localdomain ([81.2.170.96]) by smtp.gmail.com with ESMTPSA id f2sm17199422wru.14.2018.12.24.11.55.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Dec 2018 11:55:10 -0800 (PST) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Dec 2018 19:55:04 +0000 Message-Id: <20181224195504.15368-1-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181224195234.15161-1-derek.buitenhuis@gmail.com> References: <20181224195234.15161-1-derek.buitenhuis@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] 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 --- v1 had accidentally removed a cast. Woops. libavformat/mov.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 825738127b..970cd87f70 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2923,12 +2923,6 @@ 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; total_sample_count+=sample_count; }