From d66e9f1ae14155e4f9db5ce989915bbcdea364eb Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 6 Mar 2022 16:47:25 +0200 Subject: [PATCH] bluez5: a2dp-sink: stop flushing if source was removed The flush source gets removed on I/O error. We should not continue flushing after that. --- spa/plugins/bluez5/a2dp-sink.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c index a2cb6d368..4528d1651 100644 --- a/spa/plugins/bluez5/a2dp-sink.c +++ b/spa/plugins/bluez5/a2dp-sink.c @@ -579,6 +579,11 @@ static int flush_data(struct impl *this, uint64_t now_time) uint32_t total_frames; struct port *port = &this->port; + if (!this->flush_source.loop) { + /* I/O in error state */ + return -EIO; + } + total_frames = 0; again: written = 0;