forked from mirror/openmw-tes3mp
Fix 'maybe-uninitialized' warning in openal_output
This commit is contained in:
parent
df459199dd
commit
e5db5e2651
1 changed files with 5 additions and 3 deletions
|
@ -951,10 +951,11 @@ std::pair<Sound_Handle,size_t> OpenAL_Output::loadSound(const std::string &fname
|
||||||
getALError();
|
getALError();
|
||||||
|
|
||||||
std::vector<char> data;
|
std::vector<char> data;
|
||||||
ALenum format;
|
ALenum format = AL_NONE;
|
||||||
int srate;
|
int srate;
|
||||||
|
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
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.
|
||||||
if(decoder->mResourceMgr->exists(fname))
|
if(decoder->mResourceMgr->exists(fname))
|
||||||
|
@ -974,7 +975,8 @@ std::pair<Sound_Handle,size_t> OpenAL_Output::loadSound(const std::string &fname
|
||||||
format = getALFormat(chans, type);
|
format = getALFormat(chans, type);
|
||||||
if(format) decoder->readAll(data);
|
if(format) decoder->readAll(data);
|
||||||
}
|
}
|
||||||
catch(std::exception &e) {
|
catch(std::exception &e)
|
||||||
|
{
|
||||||
std::cerr<< "Failed to load audio from "<<fname<<": "<<e.what() <<std::endl;
|
std::cerr<< "Failed to load audio from "<<fname<<": "<<e.what() <<std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue