summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Chini <georg@chini.tk>2020-01-27 19:09:40 +0100
committerGeorg Chini <georg@chini.tk>2021-11-07 18:17:37 +0000
commite7abd862b140685bc7559604ba1c0a8abd876378 (patch)
tree98993bcd86a364273f5e3a9ca46a595c7cc9c7cd
parentfa3b66d24919fe7e655ce489f504369ffecb2ae8 (diff)
loopback: Do not detect underruns during initial latency adjustments
Currently module-loopback detects underruns even if sink_input_pop_cb() was not yet called twice and initial latency adjustments are active. This leads to unnecessary rewind requests. This patch delays detecting underruns until the initial adjustments are done. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/56>
-rw-r--r--src/modules/module-loopback.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index 76ce5d451..e3e260900 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -941,7 +941,8 @@ static int sink_input_process_msg_cb(pa_msgobject *obj, int code, void *data, in
* right-away */
if (u->sink_input->sink->thread_info.state != PA_SINK_SUSPENDED &&
u->sink_input->thread_info.underrun_for > 0 &&
- pa_memblockq_is_readable(u->memblockq)) {
+ pa_memblockq_is_readable(u->memblockq) &&
+ u->output_thread_info.pop_called) {
pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(u->msg), LOOPBACK_MESSAGE_UNDERRUN, NULL, 0, NULL, NULL);
/* If called from within the pop callback skip the rewind */