1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 07:53:52 +00:00

Make sure the sound decoders are closed when they're finished with

This commit is contained in:
Chris Robinson 2012-03-18 11:34:23 -07:00
parent 362e254720
commit 9656456d30
3 changed files with 4 additions and 0 deletions

View file

@ -36,6 +36,7 @@ FFmpeg_Decoder::FFmpeg_Decoder()
FFmpeg_Decoder::~FFmpeg_Decoder()
{
Close();
}
}

View file

@ -118,6 +118,7 @@ MpgSnd_Decoder::MpgSnd_Decoder() : sndFile(NULL), mpgFile(NULL)
MpgSnd_Decoder::~MpgSnd_Decoder()
{
Close();
}
}

View file

@ -332,6 +332,7 @@ Sound* OpenAL_Output::playSound(const std::string &fname, float volume, float pi
try
{
buf = LoadBuffer(decoder);
decoder->Close();
alGenSources(1, &src);
throwALerror();
}
@ -380,6 +381,7 @@ Sound* OpenAL_Output::playSound3D(const std::string &fname, const float *pos, fl
try
{
buf = LoadBuffer(decoder);
decoder->Close();
alGenSources(1, &src);
throwALerror();
}