mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 13:49:53 -06:00
Fixed annoying sound when pausing/shutting down (please test for ALL backends) (couldn't do this for CoreAudio and PulseAudio too)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4676 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -30,6 +30,8 @@ bool OpenALStream::Start()
|
||||
ALCdevice *pDevice = NULL;
|
||||
bool bReturn = false;
|
||||
|
||||
g_uiSource = 0;
|
||||
|
||||
pDeviceList = new ALDeviceList();
|
||||
if ((pDeviceList) && (pDeviceList->GetNumDevices()))
|
||||
{
|
||||
@ -125,6 +127,9 @@ void OpenALStream::SoundLoop()
|
||||
alSourceQueueBuffers(uiSource, 1, &uiBuffers[iLoop]);
|
||||
}
|
||||
//*/
|
||||
|
||||
g_uiSource = uiSource;
|
||||
|
||||
alSourcePlay(uiSource);
|
||||
err = alGetError();
|
||||
|
||||
@ -173,5 +178,17 @@ void OpenALStream::SoundLoop()
|
||||
|
||||
}
|
||||
|
||||
void OpenALStream::Mute(bool bMute) {
|
||||
if((bMute && g_muted) || (!bMute && !g_muted))
|
||||
return;
|
||||
|
||||
if(bMute && g_uiSource)
|
||||
alSourceStop(g_uiSource);
|
||||
else if(g_uiSource)
|
||||
alSourcePlay(g_uiSource);
|
||||
|
||||
g_muted = bMute;
|
||||
}
|
||||
|
||||
#endif //HAVE_OPENAL
|
||||
|
||||
|
Reference in New Issue
Block a user