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_packet(AVFormatContext *ctx, AVPacket *pkt)
{
-#if FF_API_CODED_FRAME && FF_API_LAVF_AVCTX
-FF_DISABLE_DEPRECATION_WARNINGS
- struct video_data *s = ctx->priv_data;
- AVFrame *frame = ctx->streams[0]->codec->coded_frame;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
int res;
if ((res = mmap_read_frame(ctx, pkt)) < 0) {
return res;
}
-#if FF_API_CODED_FRAME && FF_API_LAVF_AVCTX
-FF_DISABLE_DEPRECATION_WARNINGS
- if (frame && s->interlaced) {
- frame->interlaced_frame = 1;
- frame->top_field_first = s->top_field_first;
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
return pkt->size;
}