mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-25 14:11:02 +00:00
Stop/start audio driver on mute.
This commit is contained in:
parent
70de036440
commit
e8271031b6
2
driver.c
2
driver.c
@ -580,7 +580,7 @@ void init_audio(void)
|
||||
|
||||
g_extern.measure_data.buffer_free_samples_count = 0;
|
||||
|
||||
if (g_extern.audio_active && g_extern.system.audio_callback) // Threaded driver is initially stopped.
|
||||
if (g_extern.audio_active && !g_extern.audio_data.mute && g_extern.system.audio_callback) // Threaded driver is initially stopped.
|
||||
audio_start_func();
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
driver_set_nonblock_state(driver.nonblock_state);
|
||||
|
||||
if (driver.audio_data && !audio_start_func())
|
||||
if (driver.audio_data && !g_extern.audio_data.mute && !audio_start_func())
|
||||
{
|
||||
RARCH_ERR("Failed to resume audio driver. Will continue without audio.\n");
|
||||
g_extern.audio_active = false;
|
||||
|
15
retroarch.c
15
retroarch.c
@ -2223,7 +2223,7 @@ static void check_pause(void)
|
||||
RARCH_LOG("Unpaused.\n");
|
||||
if (driver.audio_data)
|
||||
{
|
||||
if (!audio_start_func())
|
||||
if (!g_extern.audio_data.mute && !audio_start_func())
|
||||
{
|
||||
RARCH_ERR("Failed to resume audio driver. Will continue without audio.\n");
|
||||
g_extern.audio_active = false;
|
||||
@ -2235,7 +2235,7 @@ static void check_pause(void)
|
||||
{
|
||||
RARCH_LOG("Unpaused.\n");
|
||||
g_extern.is_paused = false;
|
||||
if (driver.audio_data && !audio_start_func())
|
||||
if (driver.audio_data && !g_extern.audio_data.mute && !audio_start_func())
|
||||
{
|
||||
RARCH_ERR("Failed to resume audio driver. Will continue without audio.\n");
|
||||
g_extern.audio_active = false;
|
||||
@ -2581,6 +2581,17 @@ static void check_mute(void)
|
||||
msg_queue_clear(g_extern.msg_queue);
|
||||
msg_queue_push(g_extern.msg_queue, msg, 1, 180);
|
||||
|
||||
if (driver.audio_data)
|
||||
{
|
||||
if (g_extern.audio_data.mute)
|
||||
audio_stop_func();
|
||||
else if (!audio_start_func())
|
||||
{
|
||||
RARCH_ERR("Failed to unmute audio.\n");
|
||||
g_extern.audio_active = false;
|
||||
}
|
||||
}
|
||||
|
||||
RARCH_LOG("%s\n", msg);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user