diff mbox

[FFmpeg-devel,v2] mov: Remove duration-of-last-frame heuristic hack

Message ID 20181224195504.15368-1-derek.buitenhuis@gmail.com
State Accepted
Commit 8f585c3c550c2dd7b2a3575f3544a3bede28eb9f
Headers show

Commit Message

Derek Buitenhuis Dec. 24, 2018, 7:55 p.m. UTC
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 <derek.buitenhuis@gmail.com>
---
v1 had accidentally removed a cast. Woops.
 libavformat/mov.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Derek Buitenhuis Dec. 28, 2018, 4:07 p.m. UTC | #1
On 24/12/2018 19:55, Derek Buitenhuis wrote:
> 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 <derek.buitenhuis@gmail.com>
> ---
> v1 had accidentally removed a cast. Woops.
>  libavformat/mov.c | 6 ------
>  1 file changed, 6 deletions(-)

Ping.

- Derek
Carl Eugen Hoyos Dec. 29, 2018, 10:36 a.m. UTC | #2
2018-12-28 17:07 GMT+01:00, Derek Buitenhuis <derek.buitenhuis@gmail.com>:
> On 24/12/2018 19:55, Derek Buitenhuis wrote:
>> 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 <derek.buitenhuis@gmail.com>
>> ---
>> v1 had accidentally removed a cast. Woops.
>>  libavformat/mov.c | 6 ------
>>  1 file changed, 6 deletions(-)
>
> Ping.

Please provide a sample.

Carl Eugen
Derek Buitenhuis Dec. 29, 2018, 4:33 p.m. UTC | #3
On 29/12/2018 10:36, Carl Eugen Hoyos wrote:
> Please provide a sample.

I mean, the hack being removing is *obviously* wrong and against the
QTFF and ISOBMFF specs, to ignore values based on a heuristic.

However, since you insist:
    http://chromashift.org/ffmpegsamps/valid_file.mp4

- Derek
Derek Buitenhuis Jan. 1, 2019, 3:50 p.m. UTC | #4
On 24/12/2018 19:55, Derek Buitenhuis wrote:
> ---
> v1 had accidentally removed a cast. Woops.
>  libavformat/mov.c | 6 ------
>  1 file changed, 6 deletions(-)

If there are no objections, I will push in a day or two.

- Derek
Derek Buitenhuis Jan. 2, 2019, 4:03 p.m. UTC | #5
On 01/01/2019 15:50, Derek Buitenhuis wrote:
> If there are no objections, I will push in a day or two.

Pushed.

- Derek
diff mbox

Patch

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;
     }