mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 14:19:55 -06:00
release audio devices properly
This commit is contained in:
@ -1718,14 +1718,14 @@ int main(int argc, char** argv)
|
|||||||
whatIwant.channels = 1;
|
whatIwant.channels = 1;
|
||||||
whatIwant.samples = 1024;
|
whatIwant.samples = 1024;
|
||||||
whatIwant.callback = MicCallback;
|
whatIwant.callback = MicCallback;
|
||||||
audio = SDL_OpenAudioDevice(NULL, 1, &whatIwant, &whatIget, 0);
|
SDL_AudioDeviceID mic = SDL_OpenAudioDevice(NULL, 1, &whatIwant, &whatIget, 0);
|
||||||
if (!audio)
|
if (!mic)
|
||||||
{
|
{
|
||||||
printf("Mic init failed: %s\n", SDL_GetError());
|
printf("Mic init failed: %s\n", SDL_GetError());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SDL_PauseAudioDevice(audio, 0);
|
SDL_PauseAudioDevice(mic, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(MicBuffer, 0, sizeof(MicBuffer));
|
memset(MicBuffer, 0, sizeof(MicBuffer));
|
||||||
@ -1770,6 +1770,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
if (Joystick) SDL_JoystickClose(Joystick);
|
if (Joystick) SDL_JoystickClose(Joystick);
|
||||||
if (audio) SDL_CloseAudioDevice(audio);
|
if (audio) SDL_CloseAudioDevice(audio);
|
||||||
|
if (mic) SDL_CloseAudioDevice(mic);
|
||||||
|
|
||||||
Config::ScreenRotation = ScreenRotation;
|
Config::ScreenRotation = ScreenRotation;
|
||||||
Config::ScreenGap = ScreenGap;
|
Config::ScreenGap = ScreenGap;
|
||||||
|
Reference in New Issue
Block a user