From 4b202b965665bbcb55194b4ab827984e5804e3e0 Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Mon, 19 Aug 2019 14:33:53 -0400 Subject: [PATCH] a2dp-sink: fix infinite loop when buffer could not be encoded --- spa/plugins/bluez5/a2dp-sink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c index ada92762f..1dd60ef20 100644 --- a/spa/plugins/bluez5/a2dp-sink.c +++ b/spa/plugins/bluez5/a2dp-sink.c @@ -559,6 +559,10 @@ static int flush_data(struct impl *this, uint64_t now_time) n_bytes += add_data(this, src, l1); if (n_bytes <= 0) { port->need_data = true; + spa_list_remove(&b->link); + b->outstanding = true; + spa_node_call_reuse_buffer(&this->callbacks, 0, b->id); + port->ready_offset = 0; break; }