# HG changeset patch # User reimar # Date 1320570566 0 # Node ID fca8419c5f353cb2d9bcb3cd3ff2ec255a8c4c87 # Parent 9b90a6efce15baa3cdac0177644ac5cedc2d5ca2 vo md5sum: support printing to stdout. diff -r 9b90a6efce15 -r fca8419c5f35 libvo/vo_md5sum.c --- 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); } /* ------------------------------------------------------------------------- */