[Mplayer-cvslog] CVS: main cfg-mplayer-def.h,1.1,1.2 cfg-mplayer.h,1.4,1.5 cfgparser.c,1.4,1.5 cfgparser.h,1.4,1.5 mplayer.c,1.19,1.20 mplayerHQ.c,1.3,1.4

GEREOFFY arpi_esp at users.sourceforge.net
Mon Mar 19 04:45:51 CET 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv29750

Modified Files:
	cfg-mplayer-def.h cfg-mplayer.h cfgparser.c cfgparser.h 
	mplayer.c mplayerHQ.c 
Log Message:
new configfile/cmdline parser

Index: cfg-mplayer-def.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer-def.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** cfg-mplayer-def.h	2001/03/19 02:24:43	1.1
--- cfg-mplayer-def.h	2001/03/19 03:45:49	1.2
***************
*** 1,4 ****
  static char* default_config=
! "nosound=nem"
  "\n";
  
--- 1,6 ----
  static char* default_config=
! "# Write your default config options here!\n"
! "\n"
! //"nosound=nem"
  "\n";
  

Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** cfg-mplayer.h	2001/03/19 02:24:43	1.4
--- cfg-mplayer.h	2001/03/19 03:45:49	1.5
***************
*** 3,10 ****
   */
  
- #include "cfg-mplayer-func.h"
- 
  struct config conf[]={
  	/* name, pointer, type, flags, min, max */
  	{"vo", &video_driver, CONF_TYPE_STRING, 0, 0, 0},
  	{"dsp", &dsp, CONF_TYPE_STRING, 0, 0, 0},
--- 3,10 ----
   */
  
  struct config conf[]={
  	/* name, pointer, type, flags, min, max */
+ 	{"o", "Option -o has been renamed to -vo (video-out), use -vo !\n",
+             CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
  	{"vo", &video_driver, CONF_TYPE_STRING, 0, 0, 0},
  	{"dsp", &dsp, CONF_TYPE_STRING, 0, 0, 0},
***************
*** 12,21 ****
  	{"bg", &play_in_bg, CONF_TYPE_FLAG, 0, 0, 1},
  	{"nobg", &play_in_bg, CONF_TYPE_FLAG, 0, 1, 0},
! 	{"sb", &seek_to_byte, CONF_TYPE_INT, 0, 0, 0},
! 	{"ss", &seek_to_sec, CONF_TYPE_INT, 0, 0, 0},
  	{"sound", &has_audio, CONF_TYPE_FLAG, 0, 0, 1},
  	{"nosound", &has_audio, CONF_TYPE_FLAG, 0, 1, 0},
! 	{"abs", &audio_buffer_size, CONF_TYPE_INT, 0, 0, 0},
! 	{"delay", &audio_delay, CONF_TYPE_FLOAT, 0, 0, 0},
  	{"bps", &pts_from_bps, CONF_TYPE_FLAG, 0, 0, 1},
  	{"nobps", &pts_from_bps, CONF_TYPE_FLAG, 0, 1, 0},
--- 12,21 ----
  	{"bg", &play_in_bg, CONF_TYPE_FLAG, 0, 0, 1},
  	{"nobg", &play_in_bg, CONF_TYPE_FLAG, 0, 1, 0},
! 	{"sb", &seek_to_byte, CONF_TYPE_INT, CONF_MIN, 0, 0},
! 	{"ss", &seek_to_sec, CONF_TYPE_INT, CONF_MIN, 0, 0},
  	{"sound", &has_audio, CONF_TYPE_FLAG, 0, 0, 1},
  	{"nosound", &has_audio, CONF_TYPE_FLAG, 0, 1, 0},
! 	{"abs", &audio_buffer_size, CONF_TYPE_INT, CONF_MIN, 0, 0},
! 	{"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0},
  	{"bps", &pts_from_bps, CONF_TYPE_FLAG, 0, 0, 1},
  	{"nobps", &pts_from_bps, CONF_TYPE_FLAG, 0, 1, 0},
***************
*** 24,47 ****
  	{"ni", &force_ni, CONF_TYPE_FLAG, 0, 0, 1},
  	{"noni", &force_ni, CONF_TYPE_FLAG, 0, 1, 0},
! 	{"aid", &audio_id, CONF_TYPE_INT, 0, 0, 0},
! 	{"vid", &video_id, CONF_TYPE_INT, 0, 0, 0},
  	{"auds", &avi_header.audio_codec, CONF_TYPE_STRING, 0, 0, 0},
  	{"vids", &avi_header.video_codec, CONF_TYPE_STRING, 0, 0, 0},
! 	{"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, 0, 0, 0},
! 	{"fps", &force_fps, CONF_TYPE_FLOAT, 0, 0, 0},
! 	{"afm", &audio_format, CONF_TYPE_INT, 0, 0, 0},
! 	{"vcd", &vcd_track, CONF_TYPE_INT, 0, 0, 0},
! 	{"pp", &divx_quality, CONF_TYPE_INT, 0, 0, 0},
! 	{"br", &encode_bitrate, CONF_TYPE_INT, 0, 0, 0},
! 	{"x", &screen_size_x, CONF_TYPE_INT, 0, 0, 0},
! 	{"y", &screen_size_y, CONF_TYPE_INT, 0, 0, 0},
! 	{"xy", &screen_size_xy, CONF_TYPE_INT, 0, 0, 0},
  	{"fs", &fullscreen, CONF_TYPE_FLAG, 0, 0, 1},
  	{"nofs", &fullscreen, CONF_TYPE_FLAG, 0, 1, 0},
  	{"idx", &no_index, CONF_TYPE_FLAG, 0, 1, 0},
  	{"noidx", &no_index, CONF_TYPE_FLAG, 0, 0, 1},
! 	{"v", &verbose, CONF_TYPE_INT, 0, 0, 0},
! 	{"-help", cfg_func_help, CONF_TYPE_FUNC, CONF_NOCFG, 0, 0},
! 	{"h", cfg_func_help, CONF_TYPE_FUNC, CONF_NOCFG, 0, 0},
  	{NULL, NULL, 0, 0, 0, 0}
  };
--- 24,51 ----
  	{"ni", &force_ni, CONF_TYPE_FLAG, 0, 0, 1},
  	{"noni", &force_ni, CONF_TYPE_FLAG, 0, 1, 0},
! 	{"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 256},
! 	{"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, 0, 256},
  	{"auds", &avi_header.audio_codec, CONF_TYPE_STRING, 0, 0, 0},
  	{"vids", &avi_header.video_codec, CONF_TYPE_STRING, 0, 0, 0},
! 	{"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10},
! 	{"fps", &force_fps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0},
! 	{"afm", &audio_format, CONF_TYPE_INT, CONF_RANGE, 1, 6},
! 	{"vcd", &vcd_track, CONF_TYPE_INT, CONF_RANGE, 1, 99},
! 	{"divxq", "Option -divxq has been renamed to -pp (postprocessing), use -pp !\n",
!             CONF_TYPE_PRINT, 0, 0, 0},
! 	{"pp", &divx_quality, CONF_TYPE_INT, CONF_RANGE, 0, 63},
! 	{"br", &encode_bitrate, CONF_TYPE_INT, CONF_RANGE, 10000, 10000000},
! 	{"x", &screen_size_x, CONF_TYPE_INT, CONF_RANGE, 1, 4096},
! 	{"y", &screen_size_y, CONF_TYPE_INT, CONF_RANGE, 1, 4096},
! 	{"xy", &screen_size_xy, CONF_TYPE_INT, CONF_RANGE, 1, 4096},
  	{"fs", &fullscreen, CONF_TYPE_FLAG, 0, 0, 1},
  	{"nofs", &fullscreen, CONF_TYPE_FLAG, 0, 1, 0},
  	{"idx", &no_index, CONF_TYPE_FLAG, 0, 1, 0},
  	{"noidx", &no_index, 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: cfgparser.c
===================================================================
RCS file: /cvsroot/mplayer/main/cfgparser.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** cfgparser.c	2001/03/19 02:29:37	1.4
--- cfgparser.c	2001/03/19 03:45:49	1.5
***************
*** 104,112 ****
  			tmp_int = atoi(param);
  
! 			if (config[i].flags & CONF_CHK_MIN)
  				if (tmp_int < config[i].min)
  					return ERR_OUT_OF_RANGE;
  
! 			if (config[i].flags & CONF_CHK_MAX)
  				if (tmp_int > config[i].max)
  					return ERR_OUT_OF_RANGE;
--- 104,112 ----
  			tmp_int = atoi(param);
  
! 			if (config[i].flags & CONF_MIN)
  				if (tmp_int < config[i].min)
  					return ERR_OUT_OF_RANGE;
  
! 			if (config[i].flags & CONF_MAX)
  				if (tmp_int > config[i].max)
  					return ERR_OUT_OF_RANGE;
***************
*** 123,131 ****
  			tmp_float = atof(param);
  
! 			if (config[i].flags & CONF_CHK_MIN)
  				if (tmp_float < config[i].min)
  					return ERR_OUT_OF_RANGE;
  
! 			if (config[i].flags & CONF_CHK_MAX)
  				if (tmp_float > config[i].max)
  					return ERR_OUT_OF_RANGE;
--- 123,131 ----
  			tmp_float = atof(param);
  
! 			if (config[i].flags & CONF_MIN)
  				if (tmp_float < config[i].min)
  					return ERR_OUT_OF_RANGE;
  
! 			if (config[i].flags & CONF_MAX)
  				if (tmp_float > config[i].max)
  					return ERR_OUT_OF_RANGE;
***************
*** 138,146 ****
  				return ERR_MISSING_PARAM;
  
! 			if (config[i].flags & CONF_CHK_MIN)
  				if (strlen(param) < config[i].min)
  					return ERR_OUT_OF_RANGE;
  
! 			if (config[i].flags & CONF_CHK_MAX)
  				if (strlen(param) > config[i].max)
  					return ERR_OUT_OF_RANGE;
--- 138,146 ----
  				return ERR_MISSING_PARAM;
  
! 			if (config[i].flags & CONF_MIN)
  				if (strlen(param) < config[i].min)
  					return ERR_OUT_OF_RANGE;
  
! 			if (config[i].flags & CONF_MAX)
  				if (strlen(param) > config[i].max)
  					return ERR_OUT_OF_RANGE;

Index: cfgparser.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfgparser.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** cfgparser.h	2001/03/19 02:29:37	1.4
--- cfgparser.h	2001/03/19 03:45:49	1.5
***************
*** 14,19 ****
  #define CONF_TYPE_PRINT		6
  
! #define CONF_CHK_MIN		(1<<0)
! #define CONF_CHK_MAX		(1<<1)
  #define CONF_NOCFG		(1<<2)
  #define CONF_NOCMD		(1<<3)
--- 14,20 ----
  #define CONF_TYPE_PRINT		6
  
! #define CONF_MIN		(1<<0)
! #define CONF_MAX		(1<<1)
! #define CONF_RANGE		(CONF_MIN|CONF_MAX)
  #define CONF_NOCFG		(1<<2)
  #define CONF_NOCMD		(1<<3)

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** mplayer.c	2001/03/19 02:24:43	1.19
--- mplayer.c	2001/03/19 03:45:49	1.20
***************
*** 80,83 ****
--- 80,88 ----
  static int verbose=0;
  
+ static int cfg_inc_verbose(struct config *conf){
+     ++verbose;
+     return 0;
+ }
+ 
  static int max_framesize=0;
  
***************
*** 313,326 ****
  }
  
- void usage(void){
-   printf("%s",help_text);
-   exit(0);
- }
- 
- void missing_param(char *s){
-   printf("Missing parameter: %s\n", s);
-   exit(1);
- }
- 
  int divx_quality=0;
  
--- 318,321 ----
***************
*** 436,442 ****
  if(!filename){
    if(vcd_track) filename="/dev/cdrom"; 
!   else
!   //filename="MI2-Trailer.avi";
!   usage();
  }
  
--- 431,437 ----
  if(!filename){
    if(vcd_track) filename="/dev/cdrom"; 
!   else {
!     printf("%s",help_text); exit(0);
!   }
  }
  

Index: mplayerHQ.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayerHQ.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** mplayerHQ.c	2001/03/19 00:13:24	1.3
--- mplayerHQ.c	2001/03/19 03:45:49	1.4
***************
*** 80,83 ****
--- 80,88 ----
  static int verbose=0;
  
+ static int cfg_inc_verbose(struct config *conf){
+     ++verbose;
+     return 0;
+ }
+ 
  static int max_framesize=0;
  


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list