comparison libvo/vo_md5sum.c @ 34225:fca8419c5f35

vo md5sum: support printing to stdout.
author reimar
date Sun, 06 Nov 2011 09:09:26 +0000
parents ddb45e9443ec
children 5d3f93051de9
comparison
equal deleted inserted replaced
34224:9b90a6efce15 34225:fca8419c5f35
138 { 138 {
139 if (vo_config_count > 0 ) { /* Already configured */ 139 if (vo_config_count > 0 ) { /* Already configured */
140 return 0; 140 return 0;
141 } 141 }
142 142
143 if (strcmp(md5sum_outfile, "-") == 0)
144 md5sum_fd = stdout;
145 else
143 if ( (md5sum_fd = fopen(md5sum_outfile, "w") ) == NULL ) { 146 if ( (md5sum_fd = fopen(md5sum_outfile, "w") ) == NULL ) {
144 mp_msg(MSGT_VO, MSGL_ERR, "\n%s: %s\n", info.short_name, 147 mp_msg(MSGT_VO, MSGL_ERR, "\n%s: %s\n", info.short_name,
145 MSGTR_VO_CantCreateFile); 148 MSGTR_VO_CantCreateFile);
146 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s: %s\n", 149 mp_msg(MSGT_VO, MSGL_ERR, "%s: %s: %s\n",
147 info.short_name, MSGTR_VO_GenericError, strerror(errno) ); 150 info.short_name, MSGTR_VO_GenericError, strerror(errno) );
274 277
275 static void uninit(void) 278 static void uninit(void)
276 { 279 {
277 free(md5sum_outfile); 280 free(md5sum_outfile);
278 md5sum_outfile = NULL; 281 md5sum_outfile = NULL;
279 if (md5sum_fd) fclose(md5sum_fd); 282 if (md5sum_fd && md5sum_fd != stdout) fclose(md5sum_fd);
280 } 283 }
281 284
282 /* ------------------------------------------------------------------------- */ 285 /* ------------------------------------------------------------------------- */
283 286
284 static void check_events(void) 287 static void check_events(void)