bluez5: fix buffer filled check

Just check if the encode buffer is full. The max number of frames
has been obtained before.
This commit is contained in:
Wim Taymans 2020-12-04 11:59:40 +01:00
parent 106d597305
commit a592eb60a8

View file

@ -61,7 +61,6 @@ struct props {
};
#define FILL_FRAMES 2
#define MAX_FRAME_COUNT 16
#define MAX_BUFFERS 32
struct buffer {
@ -362,11 +361,11 @@ static int encode_buffer(struct impl *this, const void *data, int size)
const void *from_data = data;
int from_size = size;
spa_log_trace(this->log, NAME " %p: encode %d used %d, %d %d %d/%d",
spa_log_trace(this->log, NAME " %p: encode %d used %d, %d %d %d",
this, size, this->buffer_used, port->frame_size, this->block_size,
this->frame_count, MAX_FRAME_COUNT);
this->frame_count);
if (this->frame_count > MAX_FRAME_COUNT)
if (this->buffer_used >= (int)sizeof(this->buffer))
return -ENOSPC;
if (size < this->block_size - this->tmp_buffer_used) {