shithub: dav1d

Download patch

ref: 5c6c3accd0b70bb197c064b1cf68f88077179aa8
parent: 62069f12ea438fd911ecd1ae291f82dc32f4aa45
author: Martin Storsjö <martin@martin.st>
date: Mon Sep 24 08:28:00 EDT 2018

Fix muxers writing to stdout

--- a/tools/output/md5.c
+++ b/tools/output/md5.c
@@ -206,7 +206,7 @@
                 md5->abcd[i] >> 24);
     fprintf(md5->f, "\n");
 
-    if (md5->f != stdin)
+    if (md5->f != stdout)
         fclose(md5->f);
 }
 
--- a/tools/output/y4m2.c
+++ b/tools/output/y4m2.c
@@ -43,7 +43,7 @@
                      const Dav1dPictureParameters *p, const unsigned fps[2])
 {
     if (!strcmp(file, "-")) {
-        c->f = stdin;
+        c->f = stdout;
     } else if (!(c->f = fopen(file, "w"))) {
         fprintf(stderr, "Failed to open %s: %s\n", file, strerror(errno));
         return -1;
@@ -100,7 +100,7 @@
 }
 
 static void y4m2_close(Y4m2OutputContext *const c) {
-    if (c->f != stdin)
+    if (c->f != stdout)
         fclose(c->f);
 }
 
--- a/tools/output/yuv.c
+++ b/tools/output/yuv.c
@@ -44,7 +44,7 @@
                     const unsigned fps[2])
 {
     if (!strcmp(file, "-")) {
-        c->f = stdin;
+        c->f = stdout;
     } else if (!(c->f = fopen(file, "w"))) {
         fprintf(stderr, "Failed to open %s: %s\n", file, strerror(errno));
         return -1;
@@ -90,7 +90,7 @@
 }
 
 static void yuv_close(YuvOutputContext *const c) {
-    if (c->f != stdin)
+    if (c->f != stdout)
         fclose(c->f);
 }