Fix getframe saving empty file due to buf.bytesused always being 0
This commit is contained in:

committed by
Martijn Braam

parent
0f9d6ea6c4
commit
0cb1061e1b
@@ -269,7 +269,7 @@ main(int argc, char *argv[])
|
||||
|
||||
if (count == 0 && outfile != NULL) {
|
||||
FILE *fp = fopen(outfile, "w");
|
||||
fwrite(buffers[buf.index].start, buf.bytesused, 1, fp);
|
||||
fwrite(buffers[buf.index].start, buffers[buf.index].length, 1, fp);
|
||||
fclose(fp);
|
||||
printf("Stored frame to: %s\n", outfile);
|
||||
printf("Format: %dx%d\n", mode->width, mode->height);
|
||||
|
Reference in New Issue
Block a user