[MPlayer-cvslog] r31685 - in trunk/libmpdemux: asfheader.c demux_audio.c

reimar subversion at mplayerhq.hu
Sun Jul 11 01:11:45 CEST 2010


Author: reimar
Date: Sun Jul 11 01:11:45 2010
New Revision: 31685

Log:
Remove some pointless uses of be2me/le2me.

Modified:
   trunk/libmpdemux/asfheader.c
   trunk/libmpdemux/demux_audio.c

Modified: trunk/libmpdemux/asfheader.c
==============================================================================
--- trunk/libmpdemux/asfheader.c	Sun Jul 11 01:08:06 2010	(r31684)
+++ trunk/libmpdemux/asfheader.c	Sun Jul 11 01:11:45 2010	(r31685)
@@ -631,8 +631,7 @@ int read_asf_header(demuxer_t *demuxer,s
         for( i=0 ; i<stream_count ; i++ ) {
           stream_id = AV_RL16(ptr);
           ptr += sizeof(uint16_t);
-          memcpy(&max_bitrate, ptr, sizeof(uint32_t));// workaround unaligment bug on sparc
-          max_bitrate = le2me_32(max_bitrate);
+          max_bitrate = AV_RL32(ptr);
           ptr += sizeof(uint32_t);
           mp_msg(MSGT_HEADER,MSGL_V,"   stream id=[0x%x][%u]\n", stream_id, stream_id );
           mp_msg(MSGT_HEADER,MSGL_V,"   max bitrate=[0x%x][%u]\n", max_bitrate, max_bitrate );
@@ -652,8 +651,7 @@ int read_asf_header(demuxer_t *demuxer,s
     return 0;
   }
   // read length of chunk
-  stream_read(demuxer->stream, (char *)&data_len, sizeof(data_len));
-  data_len = le2me_64(data_len);
+  data_len = stream_read_qword_le(demuxer->stream);
   demuxer->movi_start = stream_tell(demuxer->stream) + 26;
   demuxer->movi_end = start + data_len;
   mp_msg(MSGT_HEADER, MSGL_V, "Found movie at 0x%X - 0x%X\n",

Modified: trunk/libmpdemux/demux_audio.c
==============================================================================
--- trunk/libmpdemux/demux_audio.c	Sun Jul 11 01:08:06 2010	(r31684)
+++ trunk/libmpdemux/demux_audio.c	Sun Jul 11 01:11:45 2010	(r31685)
@@ -484,13 +484,12 @@ static int demux_audio_open(demuxer_t* d
 	    if (demuxer->movi_end > demuxer->movi_start) {
 	      // try to find out approx. bitrate
 	      int64_t size = demuxer->movi_end - demuxer->movi_start;
-	      int64_t num_samples = 0;
-	      int32_t srate = 0;
+	      int64_t num_samples;
+	      int32_t srate;
 	      stream_skip(s, 14);
-	      stream_read(s, (char *)&srate, 3);
-	      srate = be2me_32(srate) >> 12;
-	      stream_read(s, (char *)&num_samples, 5);
-	      num_samples = (be2me_64(num_samples) >> 24) & 0xfffffffffULL;
+	      srate = stream_read_int24(s) >> 4;
+	      num_samples  = stream_read_int24(s) << 16;
+	      num_samples |= stream_read_word(s);
 	      if (num_samples && srate)
 	        sh_audio->i_bps = size * srate / num_samples;
 	    }


More information about the MPlayer-cvslog mailing list