v4l2-ctl: set b.num_planes to 1 for single plane output formats.
authorHans Verkuil <hans.verkuil@cisco.com>
Thu, 26 Sep 2013 09:32:41 +0000 (11:32 +0200)
committerHans Verkuil <hans.verkuil@cisco.com>
Thu, 26 Sep 2013 09:32:41 +0000 (11:32 +0200)
For normal non-multiplanar output formats b.num_planes was never set to 1,
so fill_buffer_from_file() wouldn't actually read any data from a file, since
b.num_planes was uninitialized (usually 0).

The same situation for capture formats was handled correctly, it was only the
output that failed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
utils/v4l2-ctl/v4l2-ctl-streaming.cpp

index d935870..773c54e 100644 (file)
@@ -406,6 +406,7 @@ static void do_setup_out_buffers(int fd, buffers &b, FILE *fin)
                                fill_buffer_from_file(b, buf.index, fin);
                }
                else {
+                       b.num_planes = 1;
                        b.planes[i][0].length = buf.length;
                        buf.bytesused = buf.length;
                        if (b.memory == V4L2_MEMORY_MMAP) {