Commit 1f138687 authored by Julian Bouzas's avatar Julian Bouzas Committed by Wim Taymans
Browse files

a2dpsink: only request new data when buffer is done

parent 715be5df
Pipeline #162714 passed with stages
in 1 minute and 27 seconds
......@@ -563,7 +563,10 @@ static int flush_data(struct impl *this, uint64_t now_time)
if (written > 0 && l1 > 0)
written += add_data(this, src, l1);
if (written <= 0) {
port->need_data = true;
/* only request new data when the current buffer will be fully processed in the next iteration */
if (port->ready_offset + (this->frame_count * this->codesize) >= d[0].chunk->size)
port->need_data = true;
if (written < 0 && written != -ENOSPC) {
spa_list_remove(&b->link);
b->outstanding = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment