summaryrefslogtreecommitdiffstats
path: root/audio/out/ao.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-13 13:24:11 +0100
committerwm4 <wm4@nowhere>2020-02-13 18:02:16 +0100
commitcc52a0340195b6062dbe7ec2c90c717d34101996 (patch)
treedd39d83735d5a75cb6b2f6abacd4a1c35b571b75 /audio/out/ao.c
parent374c6aff7b1a005d78f31d00fc12e714976fb7bb (diff)
downloadmpv-cc52a0340195b6062dbe7ec2c90c717d34101996.tar.bz2
mpv-cc52a0340195b6062dbe7ec2c90c717d34101996.tar.xz
audio: slightly simplify pull underrun message printing
A previous commit moved the underrun reporting to report_underruns(), and called it from get_space(). One reason was that I worried about printing a log message from a "realtime" callback, so I tried to move it out of the way. (Though there's little justification other than a bad feeling. While an older version of the pull code tried to avoid any mutexes at all in the callback to accommodate "requirements" from APIs like jackaudio, we gave up on that. Nobody has complained yet.) Simplify this and move underrun reporting back to the callback. But instead of printing the message from there, move the message into the playloop. Change the message slightly, because ao->log is inaccessible, and without the log prefix (e.g. "[ao/alsa]"), some context is missing.
Diffstat (limited to 'audio/out/ao.c')
-rw-r--r--audio/out/ao.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index a4d6ad5db6..71c17e03b0 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -469,10 +469,7 @@ void ao_hotplug_event(struct ao *ao)
// Returns whether this call actually set a new underrun flag.
bool ao_underrun_event(struct ao *ao)
{
- bool new_underrun = ao_add_events(ao, AO_EVENT_UNDERRUN);
- if (new_underrun)
- MP_WARN(ao, "Device underrun detected.\n");
- return new_underrun;
+ return ao_add_events(ao, AO_EVENT_UNDERRUN);
}
bool ao_chmap_sel_adjust(struct ao *ao, const struct mp_chmap_sel *s,