[Mplayer-cvslog] CVS: main/libmpdemux demux_real.c,1.53,1.54
Torinthiel
torinthiel at wp.pl
Thu Jan 29 23:51:25 CET 2004
On Thu, Jan 29, 2004 at 01:11:15PM +0100, Attila Kinali CVS wrote:
> Update of /cvsroot/mplayer/main/libmpdemux
> In directory mail:/var2/tmp/cvs-serv14025
>
> Modified Files:
> demux_real.c
> Log Message:
> add support for aac in real media files
> patch by Moritz Bunkus <moritz at bunkus.org>
>
>
> Index: demux_real.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libmpdemux/demux_real.c,v
> retrieving revision 1.53
> retrieving revision 1.54
> diff -u -r1.53 -r1.54
> --- demux_real.c 29 Jan 2004 10:13:35 -0000 1.53
> +++ demux_real.c 29 Jan 2004 12:11:13 -0000 1.54
> @@ -581,6 +581,26 @@
> static int cnt=0;
> static int cnt2=CRACK_MATRIX;
> #endif
> + if (((sh_audio_t *)ds->sh)->format == mmioFOURCC('M', 'P', '4', 'A')) {
> + uint16_t *sub_packet_lengths, sub_packets, i;
> + /* AAC in Real: several AAC frames in one Real packet. */
> + /* Second byte, upper four bits: number of AAC frames */
> + /* next n * 2 bytes: length of the AAC frames in bytes, BE */
> + sub_packets = (stream_read_word(demuxer->stream) & 0xf0) >> 4;
> + sub_packet_lengths = calloc(sub_packets, sizeof(uint16_t));
> + for (i = 0; i < sub_packets; i++)
> + sub_packet_lengths[i] = stream_read_word(demuxer->stream);
> + for (i = 0; i < sub_packets; i++) {
> + demux_packet_t *dp = new_demux_packet(sub_packet_lengths[i]);
> + stream_read(demuxer->stream, dp->buffer, sub_packet_lengths[i]);
> + dp->pts = (priv->a_pts == timestamp) ? 0 : (timestamp / 1000.0f);
> + priv->a_pts = timestamp;
> + dp->pos = demuxer->filepos;
> + ds_add_packet(ds, dp);
> + }
> + free(sub_packet_lengths);
> + return 1;
> + }
This piece of code should be lower. As the next line is variable
declaration it doesn't comply to C standard. And doesn't compile on gcc
2.95.4.
> demux_packet_t *dp = new_demux_packet(len);
Torinthiel
--
Waclaw "Torinthiel" Schiller GG#: 542916, 3073512
torinthiel(at)wp(dot)pl
gpg: B06901F1 fpr: FAA3 559F CAE9 34DE CDC8 7346 2B6E 39F2 B069 01F1
"No classmates may be used during this examination"
-------------- 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/mplayer-cvslog/attachments/20040129/894b4e4b/attachment.pgp>
More information about the MPlayer-cvslog
mailing list