diff libvo/vo_yuv4mpeg.c @ 34773:37af463fd7fc

yuv4mpeg: support writing to stdout instead of file.
author reimar
date Sun, 15 Apr 2012 15:09:34 +0000
parents ddb45e9443ec
children 2402be2e296f
line wrap: on
line diff
--- a/libvo/vo_yuv4mpeg.c	Sun Apr 15 15:01:09 2012 +0000
+++ b/libvo/vo_yuv4mpeg.c	Sun Apr 15 15:09:34 2012 +0000
@@ -132,7 +132,7 @@
 	write_bytes = image_width * image_height * 3 / 2;
 	image = malloc(write_bytes);
 
-	yuv_out = fopen(yuv_filename, "wb");
+	yuv_out = strcmp(yuv_filename, "-") ? fopen(yuv_filename, "wb") : stdout;
 	if (!yuv_out || image == 0)
 	{
 		mp_msg(MSGT_VO,MSGL_FATAL,
@@ -238,7 +238,7 @@
 	free(image);
 	image = NULL;
 
-	if(yuv_out)
+	if(yuv_out && yuv_out != stdout)
 		fclose(yuv_out);
 	yuv_out = NULL;