[Mplayer-cvslog] CVS: main parser-mecmd.c,1.3,1.4 parser-mpcmd.c,1.7,1.8

Alban Bedel CVS albeu at mplayerhq.hu
Sun Mar 30 19:08:38 CEST 2003


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

Modified Files:
	parser-mecmd.c parser-mpcmd.c 
Log Message:
Remove the hack used to pass -dvd, etc into the playlist


Index: parser-mecmd.c
===================================================================
RCS file: /cvsroot/mplayer/main/parser-mecmd.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- parser-mecmd.c	26 Jan 2003 12:02:38 -0000	1.3
+++ parser-mecmd.c	30 Mar 2003 17:08:35 -0000	1.4
@@ -56,16 +56,6 @@
   char *opt;
   int no_more_opts = 0;
   m_entry_t *lst = NULL, *entry = NULL;
-  void add_file(char* file) {
-    mp_msg(MSGT_CFGPARSER, MSGL_DBG2,"Adding file %s\n",argv[i]);
-    lst = realloc(lst,(nf+2)*sizeof(m_entry_t));
-    lst[nf].name = strdup(file);
-    lst[nf].opts = calloc(2,sizeof(char*));
-    entry = &lst[nf];
-    no = 0;
-    memset(&lst[nf+1],0,sizeof(m_entry_t));
-    nf++;
-  }
 	
 #ifdef MP_DEBUG
   assert(config != NULL);
@@ -104,21 +94,6 @@
 	  mp_msg(MSGT_CFGPARSER, MSGL_ERR, "%s is not an MEncoder option\n",opt);
 	  goto err_out;
 	}
-	// Hack for the -vcd ... options
-	if(strcasecmp(opt,"vcd") == 0)
-	  add_file("VCD Track");
-	if(strcasecmp(opt,"dvd") == 0)
-	  add_file("DVD Title");
-	if(strcasecmp(opt,"tv") == 0 && argv[i + 1]) { // TV is a bit more tricky
-	  char* param = argv[i + 1];
-	  char* on = strstr(param,"on");
-	  for( ; on ; on = strstr(on + 1,"on")) {
-	    if(on[2] != ':' && on[2] != '\0') continue;
-	    if(on != param && *(on - 1) != ':') continue;
-	    add_file("TV Channel");
-	    break;
-	  }
-	}
 	if(!entry || (mp_opt->flags & M_OPT_GLOBAL)){
 	  tmp = m_config_set_option(config, opt, argv[i + 1]);
 	  if(tmp < 0){
@@ -139,8 +114,16 @@
 	  }
 	}
 	i += tmp;
-      } else /* filename */
-	add_file(argv[i]);
+      } else  {/* filename */
+	mp_msg(MSGT_CFGPARSER, MSGL_DBG2,"Adding file %s\n",argv[i]);
+	lst = realloc(lst,(nf+2)*sizeof(m_entry_t));
+	lst[nf].name = strdup(argv[i]);
+	lst[nf].opts = calloc(2,sizeof(char*));
+	entry = &lst[nf];
+	no = 0;
+	memset(&lst[nf+1],0,sizeof(m_entry_t));
+	nf++;
+      }
   }
 
   if(nf == 0) {

Index: parser-mpcmd.c
===================================================================
RCS file: /cvsroot/mplayer/main/parser-mpcmd.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- parser-mpcmd.c	26 Jan 2003 16:11:35 -0000	1.7
+++ parser-mpcmd.c	30 Mar 2003 17:08:35 -0000	1.8
@@ -40,88 +40,6 @@
     entry = parse_playlist_file(param);
     if(!entry)
       return 1;
-  } else if(strcasecmp(opt,"vcd") == 0) {
-    char* s;
-    if(!param)
-      return M_OPT_MISSING_PARAM;
-    s = (char*)malloc((strlen(param) + 6 + 1)*sizeof(char));
-    sprintf(s,"vcd://%s",param);
-    entry = play_tree_new();
-    play_tree_add_file(entry,s);
-    free(s);
-  } else if(strcasecmp(opt,"dvd") == 0) {
-    char* s;
-    if(!param)
-      return M_OPT_MISSING_PARAM;
-    s = (char*)malloc((strlen(param) + 6 + 1)*sizeof(char));
-    sprintf(s,"dvd://%s",param);
-    entry = play_tree_new();
-    play_tree_add_file(entry,s);
-    free(s);
-  } else if(strcasecmp(opt,"tv") == 0) {
-    char *s,*pr,*prs;
-    char *ps,*pe,*channel=NULL;
-    char *as;
-    int on=0;
-
-    if(!param)
-      return M_OPT_MISSING_PARAM;
-    ps = param;
-    pe = strchr(param,':');
-    pr = prs = (char*)malloc((strlen(param)+1)*sizeof(char));
-    pr[0] = '\0';
-    while(ps) {
-      if(!pe)
-	pe = ps + strlen(ps);
-
-      as = strchr(ps,'=');
-      if(as && as[1] != '\0' && pe-as > 0)
-	as++;
-      else
-	as = NULL;
-      if( !as && pe-ps == 2 &&  strncasecmp("on",ps,2) == 0 )
-	on = 1;
-      else if(as  && as-ps == 8  && strncasecmp("channel",ps,6) == 0 && pe-as > 0) {
-	channel = (char*)realloc(channel,(pe-as+1)*sizeof(char));
-	strncpy(channel,as,pe-as);
-	channel[pe-as] = '\0';
-      } else if(pe-ps > 0) {
-	if(prs != pr) {
-	  prs[0] = ':';
-	  prs++;
-	}
-	strncpy(prs,ps,pe-ps);
-	prs += pe-ps;
-	prs[0] = '\0';
-      }
-
-      if(pe[0] != '\0') {
-	ps = pe+1;
-	pe = strchr(ps,':');
-      } else
-	ps = NULL;
-    }
-
-    if(on) {
-      int l=5;
-	
-      if(channel)
-	l += strlen(channel);
-      s = (char*) malloc((l+1)*sizeof(char));
-      if(channel)
-	sprintf(s,"tv://%s",channel);
-      else
-	sprintf(s,"tv://");
-      entry = play_tree_new();
-      play_tree_add_file(entry,s);
-      if(strlen(pr) > 0)
-	play_tree_set_param(entry,"tv",pr);
-      free(s);
-    }
-    free(pr);
-    if(channel)
-      free(channel);
-	  
   }
 
   if(entry) {



More information about the MPlayer-cvslog mailing list