diff options
Diffstat (limited to 'core/recipes-multimedia/ffmpeg/ffmpeg/0006-avcodec-v4l2_context-remove-unnecessary-timeout-whil.patch')
-rw-r--r-- | core/recipes-multimedia/ffmpeg/ffmpeg/0006-avcodec-v4l2_context-remove-unnecessary-timeout-whil.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/core/recipes-multimedia/ffmpeg/ffmpeg/0006-avcodec-v4l2_context-remove-unnecessary-timeout-whil.patch b/core/recipes-multimedia/ffmpeg/ffmpeg/0006-avcodec-v4l2_context-remove-unnecessary-timeout-whil.patch new file mode 100644 index 0000000..ce164c9 --- /dev/null +++ b/core/recipes-multimedia/ffmpeg/ffmpeg/0006-avcodec-v4l2_context-remove-unnecessary-timeout-whil.patch @@ -0,0 +1,58 @@ +From cfd33ff803a06d0abece75228bab803090fbdcff Mon Sep 17 00:00:00 2001 +From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> +Date: Tue, 3 Oct 2017 10:31:47 +0200 +Subject: [PATCH 6/7] avcodec/v4l2_context: remove unnecessary timeout while + draining + +This timeout was introduced to work around a bug in the test platform +used to upstream the v4l2 support (DragonBoard 410c, Venus driver). +--- + libavcodec/v4l2_context.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c +index 297792f871..7365d6c76b 100644 +--- a/libavcodec/v4l2_context.c ++++ b/libavcodec/v4l2_context.c +@@ -237,17 +237,15 @@ static V4L2Buffer* v4l2_dequeue_v4l2buf(V4L2Context *ctx, int timeout) + if (V4L2_TYPE_IS_OUTPUT(ctx->type)) + pfd.events = POLLOUT | POLLWRNORM; + ++ if (!V4L2_TYPE_IS_OUTPUT(ctx->type) && ctx_to_m2mctx(ctx)->draining) ++ pfd.events = POLLIN | POLLRDNORM | POLLPRI; ++ + for (;;) { + ret = poll(&pfd, 1, timeout); + if (ret > 0) + break; + if (errno == EINTR) + continue; +- +- /* timeout is being used to indicate last valid bufer when draining */ +- if (ctx_to_m2mctx(ctx)->draining) +- ctx->done = 1; +- + return NULL; + } + +@@ -535,7 +533,7 @@ int ff_v4l2_context_dequeue_frame(V4L2Context* ctx, AVFrame* frame) + * 1. decoded frame available + * 2. an input buffer is ready to be dequeued + */ +- avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? 200 : -1); ++ avbuf = v4l2_dequeue_v4l2buf(ctx, -1); + if (!avbuf) { + if (ctx->done) + return AVERROR_EOF; +@@ -557,7 +555,7 @@ int ff_v4l2_context_dequeue_packet(V4L2Context* ctx, AVPacket* pkt) + * 1. encoded packet available + * 2. an input buffer ready to be dequeued + */ +- avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? 200 : -1); ++ avbuf = v4l2_dequeue_v4l2buf(ctx, -1); + if (!avbuf) { + if (ctx->done) + return AVERROR_EOF; +-- +2.14.2 + |