diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-07-16 15:29:43 +0200 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-07-16 15:29:43 +0200 |
| commit | d05d162cb81664f292834fa5d48d623d2b6147a7 (patch) | |
| tree | 9d4252fcdfa2210613188d5c965514cfab6a8ec2 /src/blind-rewrite-head.c | |
| parent | Use #include instead of #define (diff) | |
| download | blind-d05d162cb81664f292834fa5d48d623d2b6147a7.tar.gz blind-d05d162cb81664f292834fa5d48d623d2b6147a7.tar.bz2 blind-d05d162cb81664f292834fa5d48d623d2b6147a7.tar.xz | |
Misc code improvements
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/blind-rewrite-head.c')
| -rw-r--r-- | src/blind-rewrite-head.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/blind-rewrite-head.c b/src/blind-rewrite-head.c index ca31006..aad19e4 100644 --- a/src/blind-rewrite-head.c +++ b/src/blind-rewrite-head.c @@ -65,7 +65,6 @@ main(int argc, char *argv[]) usage(); } ARGEND; - if (headless) { if (argc != 5) eprintf("all positional arguments are mandatory unless -h is used\n"); @@ -73,14 +72,12 @@ main(int argc, char *argv[]) usage(); } - memset(&stream, 0, sizeof(stream)); stream.file = argv[0]; stream.fd = eopen(stream.file, O_RDWR); if (!headless) einit_stream(&stream); - if (argc < 2 || !strcmp(argv[1], "auto")) frames_auto = 1; else @@ -102,14 +99,12 @@ main(int argc, char *argv[]) else if (strcmp(argv[4], "same")) { if (strlen(argv[4]) >= sizeof(stream.pixfmt)) eprintf("choosen pixel format is unsupported\n"); - strcpy(stream.pixfmt, argv[5]); - if (set_pixel_size(&stream)) + if (set_pixel_format(&stream, argv[5])) eprintf("choosen pixel format is unsupported\n"); } else if (headless) { eprintf("cannot use both 'same' and -h\n"); } - rewrite(&stream, frames_auto); close(stream.fd); return 0; |
