diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c index 224eb3d5e7..b0c3d30ac8 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -142,8 +142,12 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame) if (!s->buf_pkt.size) { ret = ff_decode_get_packet(avctx, &s->buf_pkt); - if (ret < 0 && ret != AVERROR_EOF) - return ret; + if (ret < 0) { + if (ret == AVERROR(EAGAIN)) + return ff_v4l2_context_dequeue_frame(capture, frame, 0); + else if (ret != AVERROR_EOF) + return ret; + } } if (s->draining)