summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_alsa.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-10-11 19:39:22 +0200
committerwm4 <wm4@nowhere>2019-10-11 20:02:23 +0200
commit1723b88cdde6fb773c23e70e98686ddac8ee1add (patch)
tree13a74311e75fafe0774b36fb6d1d542544760c6b /audio/out/ao_alsa.c
parentf26dfb6e4d4ecc40c157382f6fcc5a1167334afc (diff)
downloadmpv-1723b88cdde6fb773c23e70e98686ddac8ee1add.tar.bz2
mpv-1723b88cdde6fb773c23e70e98686ddac8ee1add.tar.xz
ao_alsa: use AO underrun reporting
This enables the change introduced in the previous commit for ao_alsa.
Diffstat (limited to 'audio/out/ao_alsa.c')
-rw-r--r--audio/out/ao_alsa.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index 275f5c08a0..bb67fd84a8 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -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,
};