mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 03:39:45 +00:00
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: Aman Gupta <aman@tmm1.net>
This commit is contained in:
parent
da45ad48f9
commit
c95b127733
@ -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 */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user