changeset 9747:264cb5f03131

Remove the hack used to pass -dvd, etc into the playlist
author albeu
date Sun, 30 Mar 2003 17:08:35 +0000
parents 27fff718ede6
children f74f8b809697
files parser-mecmd.c parser-mpcmd.c
diffstat 2 files changed, 10 insertions(+), 109 deletions(-) [+]
line wrap: on
line diff
--- a/parser-mecmd.c	Sun Mar 30 17:07:31 2003 +0000
+++ b/parser-mecmd.c	Sun Mar 30 17:08:35 2003 +0000
@@ -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) {
--- a/parser-mpcmd.c	Sun Mar 30 17:07:31 2003 +0000
+++ b/parser-mpcmd.c	Sun Mar 30 17:08:35 2003 +0000
@@ -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) {