diff options
author | Wim Taymans <wtaymans@redhat.com> | 2020-09-02 17:51:33 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2020-09-02 17:51:33 +0200 |
commit | b8d65895c262eac4e6a35d6adfd5873aa26673f2 (patch) | |
tree | 18352b80de44872ddc4b98e4c54daf0d73c9a301 | |
parent | b54571c5a1e73e6abd361c01f8bdf878cbb2fb46 (diff) |
a2dp: try to completely process the queue
Continue processing the input data until we can't send anymore. When
we are following another driver, we need to process each buffer in
the cycle completely or we will start lagging behind.
-rw-r--r-- | spa/plugins/bluez5/a2dp-sink.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c index 60d7b42b..ff6f523c 100644 --- a/spa/plugins/bluez5/a2dp-sink.c +++ b/spa/plugins/bluez5/a2dp-sink.c @@ -560,6 +560,7 @@ static int flush_data(struct impl *this, uint64_t now_time) struct port *port = &this->port; total_frames = 0; +again: while (!spa_list_is_empty(&port->ready)) { uint8_t *src; uint32_t n_bytes, n_frames; @@ -642,6 +643,8 @@ static int flush_data(struct impl *this, uint64_t now_time) increase_bitpool(this); this->last_error = now_time; } + if (!spa_list_is_empty(&port->ready)) + goto again; } this->flush_source.mask = 0; |