forked from mirror/openmw-tes3mp
Avoid an unnecessary string copy
This commit is contained in:
parent
aac903484c
commit
a1bdb544db
1 changed files with 5 additions and 3 deletions
|
@ -773,14 +773,16 @@ Sound_Handle OpenAL_Output::loadSound(const std::string &fname)
|
||||||
|
|
||||||
DecoderPtr decoder = mManager.getDecoder();
|
DecoderPtr decoder = mManager.getDecoder();
|
||||||
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
||||||
std::string file = fname;
|
if(decoder->mResourceMgr->exists(fname))
|
||||||
if (!decoder->mResourceMgr->exists(file))
|
decoder->open(fname);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
|
std::string file = fname;
|
||||||
std::string::size_type pos = file.rfind('.');
|
std::string::size_type pos = file.rfind('.');
|
||||||
if(pos != std::string::npos)
|
if(pos != std::string::npos)
|
||||||
file = file.substr(0, pos)+".mp3";
|
file = file.substr(0, pos)+".mp3";
|
||||||
|
decoder->open(file);
|
||||||
}
|
}
|
||||||
decoder->open(file);
|
|
||||||
|
|
||||||
std::vector<char> data;
|
std::vector<char> data;
|
||||||
ChannelConfig chans;
|
ChannelConfig chans;
|
||||||
|
|
Loading…
Reference in a new issue