diff options
author | Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> | 2018-01-10 01:56:42 +0300 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-01-21 03:37:35 +0300 |
commit | 5d5de3eba4c7890c2e8077f5b4ae569671d11cf8 (patch) | |
tree | a6f498b5b2b506cc0495a811db086c80da56644f /libavcodec/v4l2_buffers.c | |
parent | a0c624e299730c8c5800375c2f5f3c6c200053ff (diff) |
avcodec: v4l2_m2m: remove unnecessary timeout.
Qualcomm's db410c/db820 Venus driver currently present in mainline
kernel has a bug which mishandles the CMD_STOP requests causing the
decoder to block while draining [1].
This patch removes the workaround that was used to prevent that
situation.
Encoding/Decoding tested on db820c.
[1] on CMD_STOP, the driver is flushing all buffers and never raising
IPIPE which ends up in blocking on poll.
Diffstat (limited to 'libavcodec/v4l2_buffers.c')
-rw-r--r-- | libavcodec/v4l2_buffers.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c index 4e68f901b3..8e4d4d1c9f 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -213,8 +213,14 @@ static void v4l2_free_buffer(void *opaque, uint8_t *unused) if (s->reinit) { if (!atomic_load(&s->refcount)) sem_post(&s->refsync); - } else if (avbuf->context->streamon) - ff_v4l2_buffer_enqueue(avbuf); + } else { + if (s->draining) { + /* no need to queue more buffers to the driver */ + avbuf->status = V4L2BUF_AVAILABLE; + } + else if (avbuf->context->streamon) + ff_v4l2_buffer_enqueue(avbuf); + } av_buffer_unref(&avbuf->context_ref); } |