[FFmpeg-devel] [PATCH] Fix failure in av_read_frame on timestamp rollover
Stephen Dredge i
sdredge
Fri Jun 18 10:29:03 CEST 2010
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.
But no, not needed here unless there is a demuxer which doesn't set
pts_info.
Revision attached.
> [...]
>
>
>
> _______________________________________________
> 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_fix4.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100618/62aaaf1c/attachment.txt>
More information about the ffmpeg-devel
mailing list