Index: libmpdemux/open.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v retrieving revision 1.99 diff -u -r1.99 open.c --- libmpdemux/open.c 22 Aug 2004 18:47:48 -0000 1.99 +++ libmpdemux/open.c 17 Oct 2004 15:17:15 -0000 @@ -189,11 +189,41 @@ ifo_handle_t *vmg_file; tt_srpt_t *tt_srpt; ifo_handle_t *vts_file; - dvd_title = filename[6] == '\0' ? 1 : strtol(filename + 6,NULL,0); + + /** + * dvd://title:chapter-last_chapter:angle@dvd-device + * dvd://1:1-4:1@/dev/dvd + */ + int boff = 6; // dvd:// + char * pTail; + const char * dlim_main = ":"; + const char * dlim_sub = "-"; + char * main_t; + char * sub_t; + + if(strchr(filename,'@')) + dvd_device = strdup(strrchr(filename,'@') + 1); + else + dvd_device = strdup(DEFAULT_DVD_DEVICE); + + pTail = (char *)strndup(filename + boff, strlen(filename) - strlen(dvd_device) - 1 - boff); + main_t = strsep(&pTail, dlim_main); + dvd_title = main_t == '\0' ? 1 : strtol(main_t, NULL, 0); + + main_t = strsep(&pTail, dlim_main); + sub_t = strsep(&main_t, dlim_sub); + dvd_chapter = sub_t == '\0' ? 1 : strtol(sub_t, NULL, 0); + + sub_t = strsep(&main_t, dlim_sub); + dvd_last_chapter = sub_t == '\0' ? 0 : strtol(sub_t, NULL, 0); + + main_t = strsep(&pTail, dlim_main); + dvd_angle = main_t == '\0' ? 1 : strtol(main_t, NULL, 0); + + /** * Open the disc. */ - if(!dvd_device) dvd_device=strdup(DEFAULT_DVD_DEVICE); #ifdef SYS_DARWIN /* Dynamic DVD drive selection on Darwin */ if (!strcmp(dvd_device, "/dev/rdiskN")) {