mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 20:27:23 +00:00
ao_alsa: use AO underrun reporting
This enables the change introduced in the previous commit for ao_alsa.
This commit is contained in:
parent
f26dfb6e4d
commit
1723b88cdd
@ -141,7 +141,8 @@ static void handle_underrun(struct ao *ao)
|
|||||||
struct priv *p = ao->priv;
|
struct priv *p = ao->priv;
|
||||||
|
|
||||||
if (!p->final_chunk_written) {
|
if (!p->final_chunk_written) {
|
||||||
MP_WARN(ao, "Device underrun detected.\n");
|
ao_underrun_event(ao);
|
||||||
|
|
||||||
int err = snd_pcm_prepare(p->alsa);
|
int err = snd_pcm_prepare(p->alsa);
|
||||||
CHECK_ALSA_ERROR("pcm prepare error");
|
CHECK_ALSA_ERROR("pcm prepare error");
|
||||||
alsa_error: ;
|
alsa_error: ;
|
||||||
@ -1263,6 +1264,7 @@ const struct ao_driver audio_out_alsa = {
|
|||||||
.wait = audio_wait,
|
.wait = audio_wait,
|
||||||
.wakeup = ao_wakeup_poll,
|
.wakeup = ao_wakeup_poll,
|
||||||
.list_devs = list_devs,
|
.list_devs = list_devs,
|
||||||
|
.reports_underruns = true,
|
||||||
.priv_size = sizeof(struct priv),
|
.priv_size = sizeof(struct priv),
|
||||||
.global_opts = &ao_alsa_conf,
|
.global_opts = &ao_alsa_conf,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user