From 65b5df657626c1b7f867a7aaee40eb6c9b485336 Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Tue, 29 Nov 2016 12:16:25 +0100 Subject: v4l2-jpeg-codec-test: Use single write call for copying image to a file Signed-off-by: Marek Szyprowski Signed-off-by: Sylwester Nawrocki --- v4l2-jpeg-codec-test/test-jpeg.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'v4l2-jpeg-codec-test') 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); -- cgit v1.2.3