diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-12-13 09:53:08 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-12-13 09:53:08 +0000 |
commit | 5aad4a97217ff36de3a09026e2b679567b95b0a8 (patch) | |
tree | 223f17a97bf3e275acd8f090c56dbd572ca9cc13 /libmpdemux | |
parent | 80530d62104ef78d446942345b3bf2e0ee9279d0 (diff) |
Simplify: use AV_RL32/AV_RB32
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28139 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_vqf.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libmpdemux/demux_vqf.c b/libmpdemux/demux_vqf.c index adba6882af..3578803b66 100644 --- a/libmpdemux/demux_vqf.c +++ b/libmpdemux/demux_vqf.c @@ -3,6 +3,7 @@ #include <stdlib.h> #include <stdio.h> #include "libavutil/common.h" +#include "libavutil/intreadwrite.h" #include "mpbswap.h" #include "stream/stream.h" @@ -50,19 +51,19 @@ static demuxer_t* demux_open_vqf(demuxer_t* demuxer) { unsigned chunk_size; hi->size=chunk_size=stream_read_dword(s); /* include itself */ stream_read(s,chunk_id,4); - if(*((uint32_t *)&chunk_id[0])==mmioFOURCC('C','O','M','M')) + if(AV_RL32(chunk_id)==mmioFOURCC('C','O','M','M')) { char buf[chunk_size-8]; unsigned i,subchunk_size; if(stream_read(s,buf,chunk_size-8)!=chunk_size-8) return NULL; i=0; - subchunk_size=be2me_32(*((uint32_t *)&buf[0])); - hi->channelMode=be2me_32(*((uint32_t *)&buf[4])); + subchunk_size = AV_RB32(buf); + hi->channelMode = AV_RB32(buf + 4); w->nChannels=sh_audio->channels=hi->channelMode+1; /*0-mono;1-stereo*/ - hi->bitRate=be2me_32(*((uint32_t *)&buf[8])); + hi->bitRate = AV_RB32(buf + 8); sh_audio->i_bps=hi->bitRate*1000/8; /* bitrate kbit/s */ w->nAvgBytesPerSec = sh_audio->i_bps; - hi->samplingRate=be2me_32(*((uint32_t *)&buf[12])); + hi->samplingRate = AV_RB32(buf + 12); switch(hi->samplingRate){ case 44: w->nSamplesPerSec=44100; @@ -78,7 +79,7 @@ static demuxer_t* demux_open_vqf(demuxer_t* demuxer) { break; } sh_audio->samplerate=w->nSamplesPerSec; - hi->securityLevel=be2me_32(*((uint32_t *)&buf[16])); + hi->securityLevel = AV_RB32(buf + 16); w->nBlockAlign = 0; sh_audio->samplesize = 4; w->wBitsPerSample = 8*sh_audio->samplesize; @@ -88,11 +89,11 @@ static demuxer_t* demux_open_vqf(demuxer_t* demuxer) { { unsigned slen,sid; char sdata[chunk_size]; - sid=*((uint32_t *)&buf[i]); i+=4; - slen=be2me_32(*((uint32_t *)&buf[i])); i+=4; + sid = AV_RL32(buf + i); i+=4; + slen = AV_RB32(buf + i); i+=4; if(sid==mmioFOURCC('D','S','I','Z')) { - hi->Dsiz=be2me_32(*((uint32_t *)&buf[i])); + hi->Dsiz=AV_RB32(buf + i); continue; /* describes the same info as size of DATA chunk */ } memcpy(sdata,&buf[i],slen); sdata[slen]=0; i+=slen; @@ -138,7 +139,7 @@ static demuxer_t* demux_open_vqf(demuxer_t* demuxer) { } } else - if(*((uint32_t *)&chunk_id[0])==mmioFOURCC('D','A','T','A')) + if(AV_RL32(chunk_id)==mmioFOURCC('D','A','T','A')) { demuxer->movi_start=stream_tell(s); demuxer->movi_end=demuxer->movi_start+chunk_size-8; |