Commit c95b1277 authored by Aman Gupta's avatar Aman Gupta

avcodec/v4l2_context: use EAGAIN to signal when input buffers are unavailable

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: 's avatarAman Gupta <aman@tmm1.net>
parent da45ad48
......@@ -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)
......
......@@ -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 */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment