mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Fix 'maybe-uninitialized' warning in openal_output
This commit is contained in:
parent
df459199dd
commit
e5db5e2651
@ -951,10 +951,11 @@ std::pair<Sound_Handle,size_t> OpenAL_Output::loadSound(const std::string &fname
|
||||
getALError();
|
||||
|
||||
std::vector<char> data;
|
||||
ALenum format;
|
||||
ALenum format = AL_NONE;
|
||||
int srate;
|
||||
|
||||
try {
|
||||
try
|
||||
{
|
||||
DecoderPtr decoder = mManager.getDecoder();
|
||||
// Workaround: Bethesda at some point converted some of the files to mp3, but the references were kept as .wav.
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user