From 8a69f676ec182af006674bfe229d9e3d71ff9f79 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 24 Nov 2015 05:56:05 -0800 Subject: [PATCH] Remove some duplicate code --- apps/openmw/mwsound/soundmanagerimp.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/apps/openmw/mwsound/soundmanagerimp.cpp b/apps/openmw/mwsound/soundmanagerimp.cpp index d7199c0fe..d02776136 100644 --- a/apps/openmw/mwsound/soundmanagerimp.cpp +++ b/apps/openmw/mwsound/soundmanagerimp.cpp @@ -244,24 +244,6 @@ namespace MWSound DecoderPtr SoundManager::loadVoice(const std::string &voicefile) { - NameLoudnessMap::iterator lipiter = mVoiceLipBuffers.find(voicefile); - if(lipiter != mVoiceLipBuffers.end()) - { - DecoderPtr decoder = getDecoder(); - // Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav. - if(decoder->mResourceMgr->exists(voicefile)) - decoder->open(voicefile); - else - { - std::string file = voicefile; - std::string::size_type pos = file.rfind('.'); - if(pos != std::string::npos) - file = file.substr(0, pos)+".mp3"; - decoder->open(file); - } - return decoder; - } - DecoderPtr decoder = getDecoder(); // Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav. if(decoder->mResourceMgr->exists(voicefile)) @@ -275,6 +257,9 @@ namespace MWSound decoder->open(file); } + NameLoudnessMap::iterator lipiter = mVoiceLipBuffers.find(voicefile); + if(lipiter != mVoiceLipBuffers.end()) return decoder; + ChannelConfig chans; SampleType type; int srate;