On 04/06/2011 06:28 PM, Måns Rullgård wrote:
> Luca Barbato <[email protected]> writes:
> 
>> From: Michael Niedermayer <[email protected]>
>>
>> ---
>>  libavformat/mov.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/libavformat/mov.c b/libavformat/mov.c
>> index b57c1aa..6f78f56 100644
>> --- a/libavformat/mov.c
>> +++ b/libavformat/mov.c
>> @@ -1499,7 +1499,7 @@ static int mov_read_ctts(MOVContext *c, AVIOContext 
>> *pb, MOVAtom atom)
>>  
>>          sc->ctts_data[i].count   = count;
>>          sc->ctts_data[i].duration= duration;
>> -        if (duration < 0)
>> +        if (duration < 0 && i+1<entries)
>>              sc->dts_shift = FFMAX(sc->dts_shift, -duration);
>>      }
> 
> This is a dirty hack that happens to fix a broken file where the last
> ctts is wrong.  It only breaks in the first place because this hack is
> used instead of calculating it correctly, a change which was made to
> "fix" another broken file, ad nauseum.

The reporter proposed to drop that branch completely in

https://roundup.libav.org/issue2246

Index: libavformat/mov.c
===================================================================
--- libavformat/mov.c   (revision 26402)
+++ libavformat/mov.c   (working copy)
@@ -1493,8 +1493,6 @@

         sc->ctts_data[i].count   = count;
         sc->ctts_data[i].duration= duration;
-        if (duration < 0)
-            sc->dts_shift = FFMAX(sc->dts_shift, -duration);
     }

     dprintf(c->fc, "dts shift %d\n", sc->dts_shift);

Undoing

https://roundup.libav.org/issue419

Probably there is a saner way to address both.

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to