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;
}
}
}
*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;