Commit 5c6c3acc authored by Martin Storsjö's avatar Martin Storsjö Committed by Ronald S. Bultje

Fix muxers writing to stdout

parent 62069f12
...@@ -206,7 +206,7 @@ static void md5_close(MD5Context *const md5) { ...@@ -206,7 +206,7 @@ static void md5_close(MD5Context *const md5) {
md5->abcd[i] >> 24); md5->abcd[i] >> 24);
fprintf(md5->f, "\n"); fprintf(md5->f, "\n");
if (md5->f != stdin) if (md5->f != stdout)
fclose(md5->f); fclose(md5->f);
} }
......
...@@ -43,7 +43,7 @@ static int y4m2_open(Y4m2OutputContext *const c, const char *const file, ...@@ -43,7 +43,7 @@ static int y4m2_open(Y4m2OutputContext *const c, const char *const file,
const Dav1dPictureParameters *p, const unsigned fps[2]) const Dav1dPictureParameters *p, const unsigned fps[2])
{ {
if (!strcmp(file, "-")) { if (!strcmp(file, "-")) {
c->f = stdin; c->f = stdout;
} else if (!(c->f = fopen(file, "w"))) { } else if (!(c->f = fopen(file, "w"))) {
fprintf(stderr, "Failed to open %s: %s\n", file, strerror(errno)); fprintf(stderr, "Failed to open %s: %s\n", file, strerror(errno));
return -1; return -1;
...@@ -100,7 +100,7 @@ error: ...@@ -100,7 +100,7 @@ error:
} }
static void y4m2_close(Y4m2OutputContext *const c) { static void y4m2_close(Y4m2OutputContext *const c) {
if (c->f != stdin) if (c->f != stdout)
fclose(c->f); fclose(c->f);
} }
......
...@@ -44,7 +44,7 @@ static int yuv_open(YuvOutputContext *const c, const char *const file, ...@@ -44,7 +44,7 @@ static int yuv_open(YuvOutputContext *const c, const char *const file,
const unsigned fps[2]) const unsigned fps[2])
{ {
if (!strcmp(file, "-")) { if (!strcmp(file, "-")) {
c->f = stdin; c->f = stdout;
} else if (!(c->f = fopen(file, "w"))) { } else if (!(c->f = fopen(file, "w"))) {
fprintf(stderr, "Failed to open %s: %s\n", file, strerror(errno)); fprintf(stderr, "Failed to open %s: %s\n", file, strerror(errno));
return -1; return -1;
...@@ -90,7 +90,7 @@ error: ...@@ -90,7 +90,7 @@ error:
} }
static void yuv_close(YuvOutputContext *const c) { static void yuv_close(YuvOutputContext *const c) {
if (c->f != stdin) if (c->f != stdout)
fclose(c->f); fclose(c->f);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment