1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/v4l2_buffers: don't prevent enqueue capture buffer to driver

Enqueue/dequeue of the capture buffers should continue while draining.

Reference: linux/Documentation/media/uapi/v4l/dev-decoder.rst

    "The client must continue to handle both queues independently,
     similarly to normal decode operation. This includes:
     ...
     - queuing and dequeuing CAPTURE buffers, until a buffer marked with
       the V4L2_BUF_FLAG_LAST flag is dequeued"

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
This commit is contained in:
Ming Qian 2020-03-16 10:02:08 +08:00 committed by Andriy Gelman
parent e444e5bb1a
commit 7afd34050c

View File

@ -222,7 +222,7 @@ static void v4l2_free_buffer(void *opaque, uint8_t *unused)
if (!atomic_load(&s->refcount))
sem_post(&s->refsync);
} else {
if (s->draining) {
if (s->draining && V4L2_TYPE_IS_OUTPUT(avbuf->context->type)) {
/* no need to queue more buffers to the driver */
avbuf->status = V4L2BUF_AVAILABLE;
}