diff options
author | Max Horn | 2011-04-12 16:53:15 +0200 |
---|---|---|
committer | Max Horn | 2011-04-12 16:53:15 +0200 |
commit | 0ce2ca4e006a70d787481040fa844c85aac43222 (patch) | |
tree | 25fb61d7e7165ec2570ecf14a4af52e9bdb6b176 /engines/sci/sound | |
parent | a8b3501252c46c3fc4fd129fa0a945eb87f47d0a (diff) | |
download | scummvm-rg350-0ce2ca4e006a70d787481040fa844c85aac43222.tar.gz scummvm-rg350-0ce2ca4e006a70d787481040fa844c85aac43222.tar.bz2 scummvm-rg350-0ce2ca4e006a70d787481040fa844c85aac43222.zip |
COMMON: Replace MKID_BE by MKTAG
MKID_BE relied on unspecified behavior of the C++ compiler,
and as such was always a bit unsafe. The new MKTAG macro
is slightly less elegant, but does no longer depend on the
behavior of the compiler.
Inspired by FFmpeg, which has an almost identical macro.
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/audio.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 73f471b247..53311b4252 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -195,7 +195,7 @@ static bool readSOLHeader(Common::SeekableReadStream *audioStream, int headerSiz uint32 tag = audioStream->readUint32BE(); - if (tag != MKID_BE('SOL\0')) { + if (tag != MKTAG('S','O','L',0)) { warning("No 'SOL' FourCC found"); return false; } @@ -290,17 +290,17 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 Common::SeekableReadStream *compressedStream = new Common::MemoryReadStream(compressedData, audioRes->size, DisposeAfterUse::YES); switch (audioCompressionType) { - case MKID_BE('MP3 '): + case MKTAG('M','P','3',' '): #ifdef USE_MAD audioSeekStream = Audio::makeMP3Stream(compressedStream, DisposeAfterUse::YES); #endif break; - case MKID_BE('OGG '): + case MKTAG('O','G','G',' '): #ifdef USE_VORBIS audioSeekStream = Audio::makeVorbisStream(compressedStream, DisposeAfterUse::YES); #endif break; - case MKID_BE('FLAC'): + case MKTAG('F','L','A','C'): #ifdef USE_FLAC audioSeekStream = Audio::makeFLACStream(compressedStream, DisposeAfterUse::YES); #endif @@ -319,7 +319,7 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 Common::MemoryReadStream dataStream(audioRes->data, audioRes->size, DisposeAfterUse::NO); data = readSOLAudio(&dataStream, size, audioFlags, flags); } - } else if (audioRes->size > 4 && READ_BE_UINT32(audioRes->data) == MKID_BE('RIFF')) { + } else if (audioRes->size > 4 && READ_BE_UINT32(audioRes->data) == MKTAG('R','I','F','F')) { // WAVE detected Common::SeekableReadStream *waveStream = new Common::MemoryReadStream(audioRes->data, audioRes->size, DisposeAfterUse::NO); @@ -331,7 +331,7 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 waveStream->seek(0, SEEK_SET); audioStream = Audio::makeWAVStream(waveStream, DisposeAfterUse::YES); - } else if (audioRes->size > 4 && READ_BE_UINT32(audioRes->data) == MKID_BE('FORM')) { + } else if (audioRes->size > 4 && READ_BE_UINT32(audioRes->data) == MKTAG('F','O','R','M')) { // AIFF detected Common::SeekableReadStream *waveStream = new Common::MemoryReadStream(audioRes->data, audioRes->size, DisposeAfterUse::NO); |