[FFmpeg-devel] [PATCH] Fix failure in av_read_frame on timestamp rollover

Stephen Dredge i sdredge
Mon Jun 21 10:01:59 CEST 2010


On 06/18/2010 08:13 PM, Michael Niedermayer wrote:
> On Fri, Jun 18, 2010 at 06:29:03PM +1000, Stephen Dredge i wrote:
>    
>> On 06/16/2010 04:31 PM, Michael Niedermayer wrote:
>>      
>>> On Tue, Jun 15, 2010 at 04:43:14PM +1000, Stephen Dredge i wrote:
>>>
>>>        
>>>> On 06/12/2010 12:03 AM, Michael Niedermayer wrote:
>>>>
>>>>          
>>>>> On Fri, Jun 11, 2010 at 06:59:01PM +1000, Stephen Dredge i wrote:
>>>>>
>>>>>            
>>> [...]
>>>
>>>        
>>>> diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
>>>> index 00b81f1..2a85943 100644
>>>> --- a/libavutil/mathematics.c
>>>> +++ b/libavutil/mathematics.c
>>>> @@ -144,8 +144,13 @@ int av_compare_ts(int64_t ts_a, AVRational tb_a,
>>>> int64_t ts_b, AVRational tb_b){
>>>>        return 0;
>>>>    }
>>>>
>>>> -int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod){
>>>> -    int64_t c= (a-b)&   (mod-1);
>>>> +int64_t av_compare_mod(uint64_t a, uint64_t b, int mod_bits){
>>>> +    int64_t c;
>>>> +    int64_t mod;
>>>> +    if(!mod_bits || mod_bits>= 63)
>>>> +        return a-b;
>>>> +    mod= 1LL<<mod_bits;
>>>> +    c= (a-b)&   (mod-1);
>>>>        if(c>   (mod>>1))
>>>>            c-= mod;
>>>>        return c;
>>>>
>>>>          
>>> looks unneeded
>>>        
>> The !mod_bits test?, two demuxers use av_read_frame so I wasn't sure, Also
>> I was thinking of future uses.
>>      
> iam talking about the whole hunk
>
> [...]
>    
just this then?

>    
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel


-- 
   Stephen Dredge                        sdredge at tpg.com.au
_______________________________________________________________
  System Administrator
  +61 2 9850 0979

   TPG Internet
  www.tpg.com.au



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rollover_fix5.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100621/0f67069a/attachment.txt>



More information about the ffmpeg-devel mailing list