changeset 34225:fca8419c5f35

vo md5sum: support printing to stdout.
author reimar
date Sun, 06 Nov 2011 09:09:26 +0000
parents 9b90a6efce15
children 8b5513a75ab4
files libvo/vo_md5sum.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_md5sum.c	Sun Nov 06 09:01:46 2011 +0000
+++ b/libvo/vo_md5sum.c	Sun Nov 06 09:09:26 2011 +0000
@@ -140,6 +140,9 @@
         return 0;
     }
 
+    if (strcmp(md5sum_outfile, "-") == 0)
+        md5sum_fd = stdout;
+    else
     if ( (md5sum_fd = fopen(md5sum_outfile, "w") ) == NULL ) {
         mp_msg(MSGT_VO, MSGL_ERR, "\n%s: %s\n", info.short_name,
                 MSGTR_VO_CantCreateFile);
@@ -276,7 +279,7 @@
 {
     free(md5sum_outfile);
     md5sum_outfile = NULL;
-    if (md5sum_fd) fclose(md5sum_fd);
+    if (md5sum_fd && md5sum_fd != stdout) fclose(md5sum_fd);
 }
 
 /* ------------------------------------------------------------------------- */