1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-17 04:15:13 +00:00

asfheader, demux_audio: Remove some pointless be2me/le2me

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31685 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-07-10 23:11:45 +00:00 committed by Uoti Urpala
parent 5f65cbcc07
commit ce19a13986
2 changed files with 7 additions and 10 deletions

View File

@ -630,8 +630,7 @@ int read_asf_header(demuxer_t *demuxer,struct asf_priv* asf){
for( i=0 ; i<stream_count ; i++ ) { for( i=0 ; i<stream_count ; i++ ) {
stream_id = AV_RL16(ptr); stream_id = AV_RL16(ptr);
ptr += sizeof(uint16_t); ptr += sizeof(uint16_t);
memcpy(&max_bitrate, ptr, sizeof(uint32_t));// workaround unaligment bug on sparc max_bitrate = AV_RL32(ptr);
max_bitrate = le2me_32(max_bitrate);
ptr += sizeof(uint32_t); 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," 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 ); mp_msg(MSGT_HEADER,MSGL_V," max bitrate=[0x%x][%u]\n", max_bitrate, max_bitrate );
@ -651,8 +650,7 @@ int read_asf_header(demuxer_t *demuxer,struct asf_priv* asf){
return 0; return 0;
} }
// read length of chunk // read length of chunk
stream_read(demuxer->stream, (char *)&data_len, sizeof(data_len)); data_len = stream_read_qword_le(demuxer->stream);
data_len = le2me_64(data_len);
demuxer->movi_start = stream_tell(demuxer->stream) + 26; demuxer->movi_start = stream_tell(demuxer->stream) + 26;
demuxer->movi_end = start + data_len; demuxer->movi_end = start + data_len;
mp_msg(MSGT_HEADER, MSGL_V, "Found movie at 0x%X - 0x%X\n", mp_msg(MSGT_HEADER, MSGL_V, "Found movie at 0x%X - 0x%X\n",

View File

@ -481,13 +481,12 @@ static int demux_audio_open(demuxer_t* demuxer) {
if (demuxer->movi_end > demuxer->movi_start) { if (demuxer->movi_end > demuxer->movi_start) {
// try to find out approx. bitrate // try to find out approx. bitrate
int64_t size = demuxer->movi_end - demuxer->movi_start; int64_t size = demuxer->movi_end - demuxer->movi_start;
int64_t num_samples = 0; int64_t num_samples;
int32_t srate = 0; int32_t srate;
stream_skip(s, 14); stream_skip(s, 14);
stream_read(s, (char *)&srate, 3); srate = stream_read_int24(s) >> 4;
srate = be2me_32(srate) >> 12; num_samples = stream_read_int24(s) << 16;
stream_read(s, (char *)&num_samples, 5); num_samples |= stream_read_word(s);
num_samples = (be2me_64(num_samples) >> 24) & 0xfffffffffULL;
if (num_samples && srate) if (num_samples && srate)
sh_audio->i_bps = size * srate / num_samples; sh_audio->i_bps = size * srate / num_samples;
} }