aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_ssim.c
diff options
context:
space:
mode:
authorTobias Rapp <t.rapp@noa-audio.com>2015-10-20 15:34:36 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-21 22:11:33 +0200
commit18e8fac531cb4b7db3d6d36b222c99e3e8968cfe (patch)
treec126709a019119bf660232a76cfc15c507a1bd72 /libavfilter/vf_ssim.c
parent98da061461f5490bd6346869b84a49dc451f57c7 (diff)
downloadffmpeg-18e8fac531cb4b7db3d6d36b222c99e3e8968cfe.tar.gz
avfilter/vf_ssim: 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_ssim.c')
-rw-r--r--libavfilter/vf_ssim.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c
index 5cd9361f1f..b23d447003 100644
--- a/libavfilter/vf_ssim.c
+++ b/libavfilter/vf_ssim.c
@@ -223,7 +223,9 @@ static av_cold int init(AVFilterContext *ctx)
{
SSIMContext *s = ctx->priv;
- 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);
@@ -354,7 +356,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);
av_freep(&s->temp);