mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
v4l2: only produce data when needed
We should only produce data when the io area status is NEED_BUFFER.
This commit is contained in:
parent
9706c191b9
commit
574c6d4b90
1 changed files with 7 additions and 3 deletions
|
|
@ -931,9 +931,13 @@ static int mmap_read(struct impl *this)
|
||||||
d[0].chunk->stride = state->fmt.fmt.pix.bytesperline;
|
d[0].chunk->stride = state->fmt.fmt.pix.bytesperline;
|
||||||
|
|
||||||
b->outstanding = true;
|
b->outstanding = true;
|
||||||
io->buffer_id = b->outbuf->id;
|
if (io->status == SPA_RESULT_NEED_BUFFER) {
|
||||||
io->status = SPA_RESULT_HAVE_BUFFER;
|
io->buffer_id = b->outbuf->id;
|
||||||
this->callbacks->have_output(this->callbacks_data);
|
io->status = SPA_RESULT_HAVE_BUFFER;
|
||||||
|
this->callbacks->have_output(this->callbacks_data);
|
||||||
|
} else {
|
||||||
|
spa_v4l2_buffer_recycle(this, b->outbuf->id);
|
||||||
|
}
|
||||||
|
|
||||||
return SPA_RESULT_OK;
|
return SPA_RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue