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

actorid
Chris Robinson 13 years ago
parent 362e254720
commit 9656456d30

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

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

@ -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();
}

Loading…
Cancel
Save