[FFmpeg-devel] remove int readers
Michael Niedermayer
michaelni
Wed Jun 13 21:37:44 CEST 2007
Hi
On Wed, Jun 13, 2007 at 11:43:47AM -0400, Ronald S. Bultje wrote:
> Hi,
>
> On 6/13/07, Benoit Fouet <benoit.fouet at purplelabs.com> wrote:
> >
> >Ronald S. Bultje wrote:
> >>Index: ffmpeg/libavformat/mp3.c
> >>===================================================================
> >>--- ffmpeg.orig/libavformat/mp3.c 2007-06-05 02:11:13.000000000 -0400
> >>+++ ffmpeg/libavformat/mp3.c 2007-06-13 07:22:58.000000000 -0400
> >>@@ -406,7 +406,7 @@
> >> buf2 = buf;
> >>
> >> for(frames = 0; buf2 < end; frames++) {
> >>- header = (buf2[0] << 24) | (buf2[1] << 16) | (buf2[2] <<
> >8) | buf2[3];
> >>+ header = AV_RB32(buf[2]);
> >>
> >
> >buf2, no ?
> >
> >>Index: ffmpeg/libavformat/rtp.c
> >>===================================================================
> >>--- ffmpeg.orig/libavformat/rtp.c 2007-06-13 07:13:19.000000000 -0400
> >>+++ ffmpeg/libavformat/rtp.c 2007-06-13 07:37:04.000000000 -0400
> >>@@ -693,7 +693,7 @@
> >> break;
> >> default:
> >> if(s->parse_packet) {
> >>- rv= s->parse_packet(s, pkt, ×tamp, buf, len);
> >>+ rv= s->parse_packet(s, pkt, ×tamp, buf, len);
> >> } else {
> >>
> >
> >tabs are forbidden in svn
>
>
> Shouldn't be there at all... Leftover from another patchset, apologies.
>
[...]
> Index: ffmpeg/libavformat/mpegts.c
> ===================================================================
> --- ffmpeg.orig/libavformat/mpegts.c 2007-06-13 11:40:18.000000000 -0400
> +++ ffmpeg/libavformat/mpegts.c 2007-06-13 11:40:35.000000000 -0400
> @@ -698,15 +698,9 @@
>
> 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
[...]
> Index: ffmpeg/libavformat/oggparsetheora.c
> ===================================================================
> --- ffmpeg.orig/libavformat/oggparsetheora.c 2007-06-13 11:40:18.000000000 -0400
> +++ ffmpeg/libavformat/oggparsetheora.c 2007-06-13 11:40:35.000000000 -0400
> @@ -60,10 +60,7 @@
>
> 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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070613/46539f77/attachment.pgp>
More information about the ffmpeg-devel
mailing list