[Mplayer-cvslog] CVS: main/libmpdemux asfheader.c,1.30,1.31
Bertrand Baudet
bertrand at mplayer.dev.hu
Sun Apr 14 07:53:39 CEST 2002
Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv3801
Modified Files:
asfheader.c
Log Message:
Changed the big handling to make it use mplayer's endian macros.
(reworked of the patch from Guillaume Morin <guillaume at morinfr.org>)
Index: asfheader.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/asfheader.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- asfheader.c 13 Apr 2002 16:49:27 -0000 1.30
+++ asfheader.c 14 Apr 2002 05:53:36 -0000 1.31
@@ -293,19 +293,16 @@
stream_read( demuxer->stream, object, objh.size );
// FIXME: We need some endian handling below...
ptr = object;
- stream_count = *(uint16_t*)ptr;
+ stream_count = le2me_16(*(uint16_t*)ptr);
ptr += sizeof(uint16_t);
if(stream_count > 0)
streams = (uint32_t*)malloc(2*stream_count*sizeof(uint32_t));
printf(" stream count=[0x%x][%u]\n", stream_count, stream_count );
for( i=0 ; i<stream_count && ptr<((char*)object+objh.size) ; i++ ) {
- stream_id = *(uint16_t*)ptr;
+ stream_id = le2me_16(*(uint16_t*)ptr);
ptr += sizeof(uint16_t);
- max_bitrate = *(uint32_t*)ptr;
+ max_bitrate = le2me_32(*(uint32_t*)ptr);
ptr += sizeof(uint32_t);
-#ifdef WORDS_BIGENDIAN
- stream_id=bswap_16(stream_id); max_bitrate=bswap_32(max_bitrate);
-#endif
printf(" stream id=[0x%x][%u]\n", stream_id, stream_id );
printf(" max bitrate=[0x%x][%u]\n", max_bitrate, max_bitrate );
streams[2*i] = stream_id;
More information about the MPlayer-cvslog
mailing list