diff options
| author | Johannes Schickel | 2010-01-07 16:18:03 +0000 | 
|---|---|---|
| committer | Johannes Schickel | 2010-01-07 16:18:03 +0000 | 
| commit | ca5e1379452f7777fd032baeb342ce88634d1836 (patch) | |
| tree | f1433d6d557362f0dd2a79563f93b0ae35983fc4 /sound/wave.cpp | |
| parent | 2e9bae44c5f80fe18aa0545b6c868682c380497c (diff) | |
| download | scummvm-rg350-ca5e1379452f7777fd032baeb342ce88634d1836.tar.gz scummvm-rg350-ca5e1379452f7777fd032baeb342ce88634d1836.tar.bz2 scummvm-rg350-ca5e1379452f7777fd032baeb342ce88634d1836.zip | |
Create a wrapper makeLoopingAudioStream to reduce code duplcation.
svn-id: r47128
Diffstat (limited to 'sound/wave.cpp')
| -rw-r--r-- | sound/wave.cpp | 19 | 
1 files changed, 4 insertions, 15 deletions
| diff --git a/sound/wave.cpp b/sound/wave.cpp index 67aa7daa54..bcae1b7f10 100644 --- a/sound/wave.cpp +++ b/sound/wave.cpp @@ -173,21 +173,10 @@ AudioStream *makeWAVStream(Common::SeekableReadStream *stream, bool disposeAfter  		return 0;  	} -	if (type == 17) { // MS IMA ADPCM -		RewindableAudioStream *adpcm = makeADPCMStream(stream, disposeAfterUse, size, Audio::kADPCMMSIma, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign); - -		if (loop) -			return new LoopingAudioStream(adpcm, 0); -		else -			return adpcm; -	} else if (type == 2) { // MS ADPCM -		RewindableAudioStream *adpcm = makeADPCMStream(stream, disposeAfterUse, size, Audio::kADPCMMS, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign); - -		if (loop) -			return new LoopingAudioStream(adpcm, 0); -		else -			return adpcm; -	} +	if (type == 17) // MS IMA ADPCM +		return makeLoopingAudioStream(makeADPCMStream(stream, disposeAfterUse, size, Audio::kADPCMMSIma, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign), loop ? 0 : 1); +	else if (type == 2) // MS ADPCM +		return makeLoopingAudioStream(makeADPCMStream(stream, disposeAfterUse, size, Audio::kADPCMMS, rate, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign), loop ? 0 : 1);  	// Raw PCM. Just read everything at once.  	// TODO: More elegant would be to wrap the stream. | 
