diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-11-16 06:54:22 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-11-16 07:01:46 +0200 |
commit | 287b62163eed8811b6cd33716c0691d328947d48 (patch) | |
tree | 3143d2cb17b32a19e3e7e0aa428210d1bba3eb0b /parser-mpcmd.c | |
parent | 507f4fe6c7811558b1367e4b64855ae7f9bc8da8 (diff) | |
parent | b411278fbb00767b8013604157a43e0203f66f4c (diff) | |
download | mpv-287b62163eed8811b6cd33716c0691d328947d48.tar.bz2 mpv-287b62163eed8811b6cd33716c0691d328947d48.tar.xz |
Merge svn changes up to r29912
Diffstat (limited to 'parser-mpcmd.c')
-rw-r--r-- | parser-mpcmd.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/parser-mpcmd.c b/parser-mpcmd.c index 892fcfbf40..4b46d1cc02 100644 --- a/parser-mpcmd.c +++ b/parser-mpcmd.c @@ -72,7 +72,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) { int i,j,start_title=-1,end_title=-1; char *opt,*splitpos=NULL; - char entbuf[10]; + char entbuf[15]; int no_more_opts = 0; int opt_exit = 0; // flag indicating whether mplayer should exit without playing anything play_tree_t *last_parent, *last_entry = NULL, *root; @@ -217,15 +217,17 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) } else /* filename */ { + int is_dvdnav = strstr(argv[i],"dvdnav://") != NULL; play_tree_t* entry = play_tree_new(); mp_msg(MSGT_CFGPARSER, MSGL_DBG2,"Adding file %s\n",argv[i]); // if required expand DVD filename entries like dvd://1-3 into component titles - if ( strstr(argv[i],"dvd://") != NULL ) + if ( strstr(argv[i],"dvd://") != NULL || is_dvdnav) { - splitpos=strstr(argv[i]+6,"-"); + int offset = is_dvdnav ? 9 : 6; + splitpos=strstr(argv[i]+offset,"-"); if(splitpos != NULL) { - start_title=strtol(argv[i]+6,NULL,10); + start_title=strtol(argv[i]+offset,NULL,10); if (start_title<0) { //entries like dvd://-2 start title implied 1 end_title=abs(start_title); start_title=1; @@ -239,7 +241,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv) { if (j!=start_title) entry=play_tree_new(); - snprintf(entbuf,9,"dvd://%d",j); + snprintf(entbuf,sizeof(entbuf),is_dvdnav ? "dvdnav://%d" : "dvd://%d",j); play_tree_add_file(entry,entbuf); add_entry(&last_parent,&last_entry,entry); last_entry = entry; |