]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/v4l2.c
avdevice/decklink_enc: add support to specify field order
[ffmpeg] / libavdevice / v4l2.c
index ae51d837af3570d1f9c1640a0aafcced5f30a970..dada8cedeadfea40e6cbbd4ed10b2e915c41dade 100644 (file)
@@ -936,8 +936,9 @@ static int v4l2_read_header(AVFormatContext *ctx)
         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)