[Mplayer-cvslog] CVS: main cfg-mencoder.h,NONE,1.1 mencoder.c,1.10,1.11

Arpi of Ize arpi at mplayer.dev.hu
Fri Nov 2 02:25:32 CET 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv25348

Modified Files:
	mencoder.c 
Added Files:
	cfg-mencoder.h 
Log Message:
mencoder commandline handling

--- NEW FILE ---
/*
 * config for cfgparser
 */

#ifdef USE_FAKE_MONO
extern int fakemono; // defined in dec_audio.c
#endif
#ifdef HAVE_ODIVX_POSTPROCESS
extern int use_old_pp;
#endif

struct config conf[]={
	/* name, pointer, type, flags, min, max */
	{"include", cfg_include, CONF_TYPE_FUNC_PARAM, 0, 0, 0}, /* this must be the first!!! */


#include "cfg-common.h"

//	{"quiet", &quiet, CONF_TYPE_FLAG, 0, 0, 1},
	{"verbose", &verbose, CONF_TYPE_INT, CONF_RANGE, 0, 100},
	{"v", cfg_inc_verbose, CONF_TYPE_FUNC, 0, 0, 0},
//	{"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
//	{"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
//	{"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
	{NULL, NULL, 0, 0, 0, 0}
};

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- mencoder.c	1 Nov 2001 21:47:28 -0000	1.10
+++ mencoder.c	2 Nov 2001 01:25:13 -0000	1.11
@@ -27,19 +27,23 @@
 
 #include <encore2.h>
 
-#include "get_path.c"
-
 #include <lame/lame.h>
 
 //--------------------------
 
 // cache2:
+static int stream_cache_size=0;
 #ifdef USE_STREAM_CACHE
 extern int cache_fill_status;
 #else
 #define cache_fill_status 0
 #endif
 
+int vcd_track=0;
+int audio_id=-1;
+int video_id=-1;
+int dvdsub_id=-1;
+
 char *audio_codec=NULL; // override audio codec
 char *video_codec=NULL; // override video codec
 int audio_family=-1;     // override audio codec family 
@@ -50,7 +54,7 @@
 //void skip_audio_frame(sh_audio_t *sh_audio){}
 //void resync_audio_stream(sh_audio_t *sh_audio){}
 
-int verbose=1; // must be global!
+int verbose=0; // must be global!
 
 double video_time_usage=0;
 double vout_time_usage=0;
@@ -67,9 +71,26 @@
 float force_fps=0;
 float force_ofps=0; // set to 24 for inverse telecine
 
+int force_srate=0;
+
 //#include "libmpeg2/mpeg2.h"
 //#include "libmpeg2/mpeg2_internal.h"
 
+//-------------------------- config stuff:
+
+#include "cfgparser.h"
+
+static int cfg_inc_verbose(struct config *conf){ ++verbose; return 0;}
+
+static int cfg_include(struct config *conf, char *filename){
+	return parse_config_file(conf, filename);
+}
+
+#include "get_path.c"
+
+#include "cfg-mplayer-def.h"
+#include "cfg-mencoder.h"
+
 //---------------------------------------------------------------------------
 
 // mini dummy libvo:
@@ -146,7 +167,7 @@
     eof=1;
 }
 
-int main(int argc,char* argv[]){
+int main(int argc,char* argv[], char *envp[]){
 
 stream_t* stream=NULL;
 demuxer_t* demuxer=NULL;
@@ -176,11 +197,22 @@
 double v_pts_corr=0;
 double v_timer_corr=0;
 
+char** filenames=NULL;
+char* filename=NULL;
+int num_filenames;
+
 //int out_buffer_size=0x200000;
 //unsigned char* out_buffer=malloc(out_buffer_size);
 
   mp_msg_init(verbose+MSGL_STATUS);
 
+  num_filenames=parse_command_line(conf, argc, argv, envp, &filenames);
+  if(num_filenames<0) exit(1); // error parsing cmdline
+  if(!num_filenames && !vcd_track && !dvd_title){
+	printf("\nMissing filename!\n\n");
+	exit(1);
+  }
+
   // check codec.conf
   if(!parse_codec_cfg("etc/codecs.conf")){
     mp_msg(MSGT_CPLAYER,MSGL_HINT,MSGTR_CopyCodecsConf);
@@ -189,13 +221,8 @@
 
 //  dvd_title=2;
 
-  if(argc>1)
-    stream=open_stream(argv[1],0,&file_format);
-  else
-//    stream=open_stream("/1/!ize/dinosaur.dvdrip.svcd-emb.mpg",0,&file_format);
-    stream=open_stream("/3d/abcug/Weird AL - Amish Paradise (MUSIC VIDEO).mpeg",0,&file_format);
-//    stream=open_stream("/3d/divx/405divx_sm_v2[1].avi",0,&file_format);
-//    stream=open_stream("/dev/cdrom",2,&file_format); // VCD track 2
+  filename=(num_filenames>0)?filenames[0]:NULL;
+  stream=open_stream(filename,vcd_track,&file_format);
 
   if(!stream){
 	printf("Cannot open file/device\n");
@@ -204,9 +231,9 @@
 
   printf("success: format: %d  data: 0x%X - 0x%X\n",file_format, (int)(stream->start_pos),(int)(stream->end_pos));
 
-  stream_enable_cache(stream,2048*1024);
+  if(stream_cache_size) stream_enable_cache(stream,stream_cache_size*1024);
 
-  demuxer=demux_open(stream,file_format,-1,-1,-1);
+  demuxer=demux_open(stream,file_format,video_id,audio_id,dvdsub_id);
   if(!demuxer){
 	printf("Cannot open demuxer\n");
 	exit(1);
@@ -680,5 +707,7 @@
 fseek(muxer_f,0,SEEK_SET);
 aviwrite_write_header(muxer,muxer_f); // update header
 fclose(muxer_f);
+
+if(stream) free_stream(stream); // kill cache thread
 
 }




More information about the MPlayer-cvslog mailing list