goto fail;
st->codecpar->format = ff_fmt_v4l2ff(desired_format, codec_id);
- s->frame_size = av_image_get_buffer_size(st->codecpar->format,
- s->width, s->height, 1);
+ if (st->codecpar->format != AV_PIX_FMT_NONE)
+ s->frame_size = av_image_get_buffer_size(st->codecpar->format,
+ s->width, s->height, 1);
if ((res = mmap_init(ctx)) ||
(res = mmap_start(ctx)) < 0)
#endif
int res;
- av_init_packet(pkt);
if ((res = mmap_read_frame(ctx, pkt)) < 0) {
return res;
}