From d1b1b849355528412794892b4a3fe527e3e5cfd3 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Thu, 31 Dec 2020 00:15:27 +0200 Subject: [PATCH] sco-sink: don't stop timeouts if more data is needed The sink timeouts need to continue even if there is currently not enough data, as otherwise playback will stop. --- spa/plugins/bluez5/sco-sink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spa/plugins/bluez5/sco-sink.c b/spa/plugins/bluez5/sco-sink.c index b5fe5bf16..3bb5f6640 100644 --- a/spa/plugins/bluez5/sco-sink.c +++ b/spa/plugins/bluez5/sco-sink.c @@ -349,6 +349,10 @@ static void flush_data(struct impl *this) port->current_buffer = NULL; port->io->status = SPA_STATUS_NEED_DATA; spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_DATA); + + next_timeout = (this->transport->write_mtu / port->frame_size + * SPA_NSEC_PER_SEC / port->current_format.info.raw.rate); + set_timeout(this, next_timeout); return; }