ao_alsa: use AO underrun reporting

This enables the change introduced in the previous commit for ao_alsa.
This commit is contained in:
wm4 2019-10-11 19:39:22 +02:00
parent f26dfb6e4d
commit 1723b88cdd
1 changed files with 3 additions and 1 deletions

View File

@ -141,7 +141,8 @@ static void handle_underrun(struct ao *ao)
struct priv *p = ao->priv;
if (!p->final_chunk_written) {
MP_WARN(ao, "Device underrun detected.\n");
ao_underrun_event(ao);
int err = snd_pcm_prepare(p->alsa);
CHECK_ALSA_ERROR("pcm prepare error");
alsa_error: ;
@ -1263,6 +1264,7 @@ const struct ao_driver audio_out_alsa = {
.wait = audio_wait,
.wakeup = ao_wakeup_poll,
.list_devs = list_devs,
.reports_underruns = true,
.priv_size = sizeof(struct priv),
.global_opts = &ao_alsa_conf,
};