X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavdevice%2Fv4l2.c;h=365bacd7714b64821560bfde2fac2e963d9153d3;hb=45fc214ebfcdf36b935632edda54aee9e8745550;hp=1b9c6e760b419247ba95df33828012f45164acef;hpb=b2f32d60eeaf883bb7d9e1b8cc2fb9a983d08f72;p=ffmpeg diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 1b9c6e760b4..365bacd7714 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -538,11 +538,10 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt) s->frame_size = buf.bytesused; if (s->frame_size > 0 && buf.bytesused != s->frame_size) { - av_log(ctx, AV_LOG_ERROR, + av_log(ctx, AV_LOG_WARNING, "Dequeued v4l2 buffer contains %d bytes, but %d were expected. Flags: 0x%08X.\n", buf.bytesused, s->frame_size, buf.flags); - enqueue_buffer(s, &buf); - return AVERROR_INVALIDDATA; + buf.bytesused = 0; } } @@ -812,11 +811,12 @@ static int device_try_init(AVFormatContext *ctx, } *codec_id = ff_fmt_v4l2codec(*desired_format); - av_assert0(*codec_id != AV_CODEC_ID_NONE); + if (*codec_id == AV_CODEC_ID_NONE) + av_assert0(ret == AVERROR(EINVAL)); return ret; } -static int v4l2_read_probe(AVProbeData *p) +static int v4l2_read_probe(const AVProbeData *p) { if (av_strstart(p->filename, "/dev/video", NULL)) return AVPROBE_SCORE_MAX - 1;