mirror of
https://github.com/libretro/RetroArch
synced 2025-02-10 12:40:03 +00:00
Pause audio when going into RGUI.
This commit is contained in:
parent
de01d42cd8
commit
74f3e8e11c
@ -115,8 +115,9 @@ static void stream_latency_update_cb(pa_stream *s, void *data)
|
||||
static void underrun_update_cb(pa_stream *s, void *data)
|
||||
{
|
||||
(void)s;
|
||||
(void)data;
|
||||
RARCH_LOG("[PulseAudio]: Underrun!\n");
|
||||
pa_t *pa = (pa_t*)data;
|
||||
RARCH_LOG("[PulseAudio]: Underrun (Buffer is %.2f %% full).\n",
|
||||
100.0f * (float)(pa->buffer_size - pa_stream_writable_size(pa->stream)) / pa->buffer_size);
|
||||
}
|
||||
|
||||
static void *pulse_init(const char *device, unsigned rate, unsigned latency)
|
||||
|
@ -89,8 +89,20 @@ int main(int argc, char *argv[])
|
||||
g_extern.lifecycle_mode_state |= 1ULL << MODE_MENU_PREINIT;
|
||||
// Menu should always run with vsync on.
|
||||
video_set_nonblock_state_func(false);
|
||||
|
||||
if (driver.audio_data)
|
||||
audio_stop_func();
|
||||
|
||||
while (menu_iterate());
|
||||
|
||||
driver_set_nonblock_state(driver.nonblock_state);
|
||||
|
||||
if (driver.audio_data && !audio_start_func())
|
||||
{
|
||||
RARCH_ERR("Failed to resume audio driver. Will continue without audio.\n");
|
||||
g_extern.audio_active = false;
|
||||
}
|
||||
|
||||
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU);
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user