aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_psnr.c
diff options
context:
space:
mode:
authorTobias Rapp <t.rapp@noa-audio.com>2015-10-20 15:02:21 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-21 00:39:50 +0200
commit1ec8c1554ed81a31ac4f82621121405de067b21e (patch)
treeb7124d9231c6679742ddda336a6b6312367f9d41 /libavfilter/vf_psnr.c
parent451b6a990a1122533f01ad6bb8734e1e58307a15 (diff)
downloadffmpeg-1ec8c1554ed81a31ac4f82621121405de067b21e.tar.gz
avfilter/vf_psnr: Add support for writing stats to stdout
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter/vf_psnr.c')
-rw-r--r--libavfilter/vf_psnr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
index a01b2c12ce..bfb0711950 100644
--- a/libavfilter/vf_psnr.c
+++ b/libavfilter/vf_psnr.c
@@ -193,7 +193,9 @@ static av_cold int init(AVFilterContext *ctx)
s->min_mse = +INFINITY;
s->max_mse = -INFINITY;
- if (s->stats_file_str) {
+ if (!strcmp(s->stats_file_str, "-")) {
+ s->stats_file = stdout;
+ } else if (s->stats_file_str) {
s->stats_file = fopen(s->stats_file_str, "w");
if (!s->stats_file) {
int err = AVERROR(errno);
@@ -334,7 +336,7 @@ static av_cold void uninit(AVFilterContext *ctx)
ff_dualinput_uninit(&s->dinput);
- if (s->stats_file)
+ if (s->stats_file && s->stats_file != stdout)
fclose(s->stats_file);
}