[FFmpeg-devel] remove int readers
Ramiro Ribeiro Polla
ramiro
Fri Jun 22 22:24:15 CEST 2007
Ronald S. Bultje wrote:
> Hi,
>
> On 6/13/07, Michael Niedermayer <michaelni at gmx.at> wrote:
>>
>> On Wed, Jun 13, 2007 at 11:43:47AM -0400, Ronald S. Bultje wrote:
>> > static int64_t get_pts(const uint8_t *p)
>> > {
>> > - int64_t pts;
>> > - int val;
>> > -
>> > - pts = (int64_t)((p[0] >> 1) & 0x07) << 30;
>> > - val = (p[1] << 8) | p[2];
>> > - pts |= (int64_t)(val >> 1) << 15;
>> > - val = (p[3] << 8) | p[4];
>> > - pts |= (int64_t)(val >> 1);
>> > - return pts;
>> > + return (int64_t)(((p[0] >> 1) & 0x07) << 30) |
>> > + (int64_t) ((AV_RB16(p + 1) >> 1) << 15) |
>> > + (int64_t) (AV_RB16(p + 3) >> 1);
>> > }
>>
>> 2/3 of the casts are unneeded and the 3rd is wrongly placed so this
>> will not work
>> [...]
>> > skip_bits(&gb, 7*8); /* 0x80"theora" */
>> >
>> > - version = get_bits(&gb, 8) << 16;
>> > - version |= get_bits(&gb, 8) << 8;
>> > - version |= get_bits(&gb, 8);
>> > -
>> > + version = get_be24(&gb);
>>
>> this is total nonsense and gcc will give you are warning
>> please try to compile your changes and look at the compiler warnings
>> before submitting it
>
>
> Apologies, new patch attached. This one may actually work. :-).
>
It no longer applies. Could you send an updated patch?
And please svn diff it from the source folder.
Ramiro Polla
More information about the ffmpeg-devel
mailing list