[FFmpeg-devel] [PATCH] Fix failure in av_read_frame on timestamp rollover
Michael Niedermayer
michaelni
Fri Jun 18 12:13:42 CEST 2010
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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100618/c09712ef/attachment.pgp>
More information about the ffmpeg-devel
mailing list