summaryrefslogtreecommitdiff
path: root/v4l2-jpeg-codec-test
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2016-11-29 12:16:25 +0100
committerSylwester Nawrocki <s.nawrocki@samsung.com>2016-11-29 12:22:19 +0100
commit65b5df657626c1b7f867a7aaee40eb6c9b485336 (patch)
tree7d8973869cc96281d4e7b6529ed9ab15b41f3496 /v4l2-jpeg-codec-test
parent891ea2e9951290f411878bcd2893c81a909c98ad (diff)
v4l2-jpeg-codec-test: Use single write call for copying image to a file
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Diffstat (limited to 'v4l2-jpeg-codec-test')
-rw-r--r--v4l2-jpeg-codec-test/test-jpeg.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/v4l2-jpeg-codec-test/test-jpeg.c b/v4l2-jpeg-codec-test/test-jpeg.c
index ed3c650..44fb292 100644
--- a/v4l2-jpeg-codec-test/test-jpeg.c
+++ b/v4l2-jpeg-codec-test/test-jpeg.c
@@ -665,11 +665,7 @@ int main(int argc, char *argv[])
int out_fd = open(output_filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
printf("Generating output file...\n");
- char x;
- for (i = 0; i < capture_buffer_sz; ++i) {
- x = p_dst_buf[i];
- write(out_fd, (const void * )&x, 1);
- }
+ write(out_fd, p_dst_buf, capture_buffer_sz);
close(out_fd);
printf("Output file: %s, size: %d\n", output_filename, capture_buffer_sz);