[FFmpeg-devel,5/8] avcodec/v4l2_context: log VIDIOC_REQBUFS failures

Submitted by Aman Gupta on Aug. 22, 2019, 9:47 p.m.

Details

Message ID 20190822214741.12456-5-ffmpeg@tmm1.net
State Accepted
Commit 87daee944b119299c9057440c71aa4a524ef5734
Headers show

Commit Message

Aman Gupta Aug. 22, 2019, 9:47 p.m.
From: Aman Gupta <aman@tmm1.net>

Signed-off-by: Aman Gupta <aman@tmm1.net>
---
 libavcodec/v4l2_context.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c
index efcb0426e4..4958c634bf 100644
--- a/libavcodec/v4l2_context.c
+++ b/libavcodec/v4l2_context.c
@@ -678,8 +678,10 @@  int ff_v4l2_context_init(V4L2Context* ctx)
     req.memory = V4L2_MEMORY_MMAP;
     req.type = ctx->type;
     ret = ioctl(s->fd, VIDIOC_REQBUFS, &req);
-    if (ret < 0)
+    if (ret < 0) {
+        av_log(logger(ctx), AV_LOG_ERROR, "%s VIDIOC_REQBUFS failed: %s\n", ctx->name, strerror(errno));
         return AVERROR(errno);
+    }
 
     ctx->num_buffers = req.count;
     ctx->buffers = av_mallocz(ctx->num_buffers * sizeof(V4L2Buffer));