[MPlayer-cvslog] r34861 - trunk/libvo/vo_yuv4mpeg.c

reimar subversion at mplayerhq.hu
Sun Apr 15 17:09:34 CEST 2012


Author: reimar
Date: Sun Apr 15 17:09:34 2012
New Revision: 34861

Log:
yuv4mpeg: support writing to stdout instead of file.

Modified:
   trunk/libvo/vo_yuv4mpeg.c

Modified: trunk/libvo/vo_yuv4mpeg.c
==============================================================================
--- trunk/libvo/vo_yuv4mpeg.c	Sun Apr 15 17:01:09 2012	(r34860)
+++ trunk/libvo/vo_yuv4mpeg.c	Sun Apr 15 17:09:34 2012	(r34861)
@@ -132,7 +132,7 @@ static int config(uint32_t width, uint32
 	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 @@ static void uninit(void)
 	free(image);
 	image = NULL;
 
-	if(yuv_out)
+	if(yuv_out && yuv_out != stdout)
 		fclose(yuv_out);
 	yuv_out = NULL;
 


More information about the MPlayer-cvslog mailing list