[xiph-commits] r8610 - trunk/ffmpeg2theora

j at motherfish-iii.xiph.org j at motherfish-iii.xiph.org
Tue Jan 4 10:24:01 PST 2005


Author: j
Date: 2005-01-04 10:24:00 -0800 (Tue, 04 Jan 2005)
New Revision: 8610

Modified:
   trunk/ffmpeg2theora/ChangeLog
   trunk/ffmpeg2theora/ffmpeg2theora.c
Log:
- better support for stdout on win32, to allow ezstream streaming non-theora source types



Modified: trunk/ffmpeg2theora/ChangeLog
===================================================================
--- trunk/ffmpeg2theora/ChangeLog	2005-01-04 17:35:26 UTC (rev 8609)
+++ trunk/ffmpeg2theora/ChangeLog	2005-01-04 18:24:00 UTC (rev 8610)
@@ -1,8 +1,9 @@
-svn 	2004-??-??
+svn 	2005-??-??
 	- add new command line options, starttime, endtime
 	- fix compile issues with new version of faad
+	- better support for stdout on win32,
+	   to allow ezstream streaming non-theora source types
 
-
 0.12 	2004-11-18
 	- add more command line options, for bitrate modes, metadata
 	- update kino plugin

Modified: trunk/ffmpeg2theora/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/ffmpeg2theora.c	2005-01-04 17:35:26 UTC (rev 8609)
+++ trunk/ffmpeg2theora/ffmpeg2theora.c	2005-01-04 18:24:00 UTC (rev 8610)
@@ -30,6 +30,10 @@
 #include "vorbis/codec.h"
 #include "vorbis/vorbisenc.h"
 
+#ifdef WIN32
+#include "fcntl.h"
+#endif
+
 #include "theorautils.h"
 
 static double rint(double x)
@@ -421,8 +425,8 @@
 			info.ti.keyframe_mindistance = 8;
 			info.ti.noise_sensitivity = 1;
 			// range 0-2, 0 sharp, 2 less sharp,less bandwidth
-			if(info.preset == V2V_PRESET_PREVIEW)
-				info.ti.sharpness=2;
+			// if(info.preset == V2V_PRESET_PREVIEW)
+			info.ti.sharpness=2;
 			
 		}
 		/* audio settings here */
@@ -964,19 +968,17 @@
 	
 	while(optind<argc){
 		/* assume that anything following the options must be a filename */
-		if(!strcmp(argv[optind],"-")){
+		sprintf(inputfile_name,"%s",argv[optind]);
+		if(!strcmp(inputfile_name,"-")){
 			sprintf(inputfile_name,"pipe:");
 		}
-		else{
-			sprintf(inputfile_name,"%s",argv[optind]);
-			if(outputfile_set!=1){
-				sprintf(outputfile_name,"%s.ogg",argv[optind]);
-				outputfile_set=1;
-			}	
+		if(outputfile_set!=1){
+			sprintf(outputfile_name,"%s.ogg",argv[optind]);
+			outputfile_set=1;
 		}
 		optind++;
 	}
-	
+
 	//FIXME: is using_stdin still neded? is it needed as global variable?
 	using_stdin |= !strcmp(inputfile_name, "pipe:" ) ||
                    !strcmp( inputfile_name, "/dev/stdin" );
@@ -1002,7 +1004,20 @@
 
 	if (av_open_input_file(&convert->context, inputfile_name, input_fmt, 0, NULL) >= 0){
 			if (av_find_stream_info (convert->context) >= 0){
+#ifdef WIN32
+				if(!strcmp(outputfile_name,"-")){
+					_setmode(_fileno(stdout), _O_BINARY);
+					info.outfile = stdout;
+				}
+				else {
+					info.outfile = fopen(outputfile_name,"wb");
+				}
+#else
+				if(!strcmp(outputfile_name,"-")){
+					sprintf(outputfile_name,"/dev/stdout");
+				}
 				info.outfile = fopen(outputfile_name,"wb");
+#endif
 				dump_format (convert->context, 0,inputfile_name, 0);
 				if(convert->disable_audio){
 					fprintf(stderr,"  [audio disabled].\n");



More information about the commits mailing list