]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/v4l2_context: use EAGAIN to signal when input buffers are unavailable
authorAman Gupta <aman@tmm1.net>
Wed, 28 Aug 2019 23:42:46 +0000 (16:42 -0700)
committerAman Gupta <aman@tmm1.net>
Mon, 2 Sep 2019 22:08:34 +0000 (15:08 -0700)
ENOMEM indicates an allocation failure, and there are no allocations
happening here. The buffers are pre-allocated and there are simply
none available at this time.

Signed-off-by: Aman Gupta <aman@tmm1.net>
libavcodec/v4l2_context.c
libavcodec/v4l2_m2m_dec.c

index c28d46d77745c5aeb3f7602356f4b5f48b997b27..6924760840f7238b757e2a681fd1430aa339aa80 100644 (file)
@@ -572,7 +572,7 @@ int ff_v4l2_context_enqueue_packet(V4L2Context* ctx, const AVPacket* pkt)
 
     avbuf = v4l2_getfree_v4l2buf(ctx);
     if (!avbuf)
-        return AVERROR(ENOMEM);
+        return AVERROR(EAGAIN);
 
     ret = ff_v4l2_buffer_avpkt_to_buf(pkt, avbuf);
     if (ret)
index 6f31772f4c25fffec52b8c6f8eb1614c4576a8df..5fb8ddd5423199a737a7d871f6defa0a23ab5021 100644 (file)
@@ -142,7 +142,7 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame)
 
     ret = ff_v4l2_context_enqueue_packet(output, &avpkt);
     if (ret < 0) {
-        if (ret != AVERROR(ENOMEM))
+        if (ret != AVERROR(EAGAIN))
            return ret;
         /* no input buffers available, continue dequeing */
     }