a2dpsink: only request new data when buffer is done

This commit is contained in:
Julian Bouzas 2020-06-17 13:36:05 -04:00 committed by Wim Taymans
parent 715be5dfe7
commit 1f1386879b

View file

@ -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) {
/* 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;