[FFmpeg-devel] [PATCH] tools/ffeval: do not use UNIX-specific /dev/std{in, out} files
Stefano Sabatini
stefasab at gmail.com
Mon Oct 15 21:59:06 CEST 2012
Should fix behavior when /dev/ directory is not defined.
---
tools/ffeval.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/tools/ffeval.c b/tools/ffeval.c
index d1d40c5..0fab877 100644
--- a/tools/ffeval.c
+++ b/tools/ffeval.c
@@ -83,17 +83,23 @@ int main(int argc, char **argv)
}
}
- if (!infilename || !strcmp(infilename, "-"))
- infilename = "/dev/stdin";
- infile = fopen(infilename, "r");
+ if (!infilename || !strcmp(infilename, "-")) {
+ infilename = "stdin";
+ infile = stdin;
+ } else {
+ infile = fopen(infilename, "r");
+ }
if (!infile) {
fprintf(stderr, "Impossible to open input file '%s': %s\n", infilename, strerror(errno));
return 1;
}
- if (!outfilename || !strcmp(outfilename, "-"))
- outfilename = "/dev/stdout";
- outfile = fopen(outfilename, "w");
+ if (!outfilename || !strcmp(outfilename, "-")) {
+ outfilename = "stdout";
+ outfile = stdout;
+ } else {
+ outfile = fopen(outfilename, "w");
+ }
if (!outfile) {
fprintf(stderr, "Impossible to open output file '%s': %s\n", outfilename, strerror(errno));
return 1;
--
1.7.5.4
More information about the ffmpeg-devel
mailing list