summaryrefslogtreecommitdiff
path: root/tools/ffeval.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-10-15 21:53:35 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-10-16 13:51:44 +0200
commit25f3827e1daf6b75e6b46e2bccaf8cbc273d6b42 (patch)
tree08acd33179e518f20db30ed13664bdf880ee6490 /tools/ffeval.c
parent7ca102a7d7bd610f66ceb1256c3cb600091c8cda (diff)
downloadffmpeg-25f3827e1daf6b75e6b46e2bccaf8cbc273d6b42.tar.gz
tools/ffeval: do not use UNIX-specific /dev/std{in,out} files
Should fix behavior when the /dev/ directory is not defined (e.g. on Windows).
Diffstat (limited to 'tools/ffeval.c')
-rw-r--r--tools/ffeval.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/ffeval.c b/tools/ffeval.c
index d1d40c55d3..0fab8775e6 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;