changeset 5597:e9ceb08cc007

bigendlian fix by Guillaume Morin <guillaume@morinfr.org>
author arpi
date Sat, 13 Apr 2002 16:49:27 +0000
parents 70e88ec799b4
children efc798ab5822
files libmpdemux/asfheader.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/asfheader.c	Sat Apr 13 14:24:33 2002 +0000
+++ b/libmpdemux/asfheader.c	Sat Apr 13 16:49:27 2002 +0000
@@ -301,9 +301,12 @@
         for( i=0 ; i<stream_count && ptr<((char*)object+objh.size) ; i++ ) {
           stream_id = *(uint16_t*)ptr;
           ptr += sizeof(uint16_t);
-          printf("   stream id=[0x%x][%u]\n", stream_id, stream_id );
           max_bitrate = *(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;
           streams[2*i+1] = max_bitrate;