]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_ssim.c
Merge commit 'fb472e1a11a4e0caed2c3c91da01ea8e35d9e3f8'
[ffmpeg] / libavfilter / vf_ssim.c
index 5cd9361f1ff5d3b934ed211eb9157cee2336a233..b23d44700307e5a771dde1b69291bad9e248fce2 100644 (file)
@@ -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);