From: Rocky B. <ro...@us...> - 2003-05-18 05:41:56
|
Update of /cvsroot/xine/xine-vcdnav/input In directory sc8-pr-cvs1:/tmp/cvs-serv32074 Modified Files: xineplug_inp_vcd.c Log Message: Bugs: - Check for specifying an invalid LID and if so, don't set PBC. - If play type not specified, silently convert LID to track if there is no PBC. Index: xineplug_inp_vcd.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/input/xineplug_inp_vcd.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -r1.85 -r1.86 --- xineplug_inp_vcd.c 16 May 2003 07:37:46 -0000 1.85 +++ xineplug_inp_vcd.c 18 May 2003 05:41:53 -0000 1.86 @@ -391,19 +391,28 @@ vcdx://dev/cdrom2:1 - Play track 1 from /dev/cdrom2 vcdx://tmp/ntsc.bin: - Play default item from /tmp/ntsc.bin vcdx://tmp/ntsc.bin/:E0 - Play entry 0 of /tmp/ntsc.bin + +parameters: + mrl : mrl to parse + default_vcd_device: name of device to use when none given + auto_type : type of selection (entry, track, LID) when none given + used_default : true iff auto_type was used. + */ static bool vcd_parse_mrl(/*in*/ const char *default_vcd_device, /*in*/ char *mrl, /*out*/ char *device_str, /*out*/ vcdinfo_itemid_t *itemid, - vcdplayer_autoplay_t auto_type) + /*in */ vcdplayer_autoplay_t auto_type, + /*out*/ bool *used_default) { char type_str[2]; int count; char *p; unsigned int num = 0; - type_str[0]='\0'; - itemid->type = (vcdinfo_item_enum_t) auto_type; + type_str[0] ='\0'; + itemid->type = (vcdinfo_item_enum_t) auto_type; + *used_default = false; if ( NULL != mrl && !strncasecmp(mrl, MRL_PREFIX, MRL_PREFIX_LEN) ) p = &mrl[MRL_PREFIX_LEN]; @@ -471,6 +480,7 @@ case '\0': /* None specified, use config value. */ itemid->type = (vcdinfo_item_enum_t) auto_type; + *used_default = true; break; case 'P': itemid->type = VCDINFO_ITEM_TYPE_LID; @@ -760,6 +770,7 @@ vcdinfo_itemid_t itemid; vcd_input_class_t *class = (vcd_input_class_t *) this_gen; + bool used_default; if (filename == NULL) { dbg_print((INPUT_DBG_CALL|INPUT_DBG_XINECALL), @@ -774,7 +785,7 @@ "called with %s\n", filename); if (!vcd_parse_mrl(my_vcd.player.default_vcd_device, mrl, intended_vcd_device, &itemid, - my_vcd.player.default_autoplay)) { + my_vcd.player.default_autoplay, &used_default)) { *num_files = 0; free (mrl); return NULL; @@ -1386,6 +1397,7 @@ char intended_vcd_device[1024]=""; vcdinfo_itemid_t itemid; char *test_mrl=NULL; + bool used_default; if (mrl == NULL) test_mrl = strdup(MRL_PREFIX); @@ -1396,8 +1408,8 @@ "Called with %s\n", test_mrl); if (!vcd_parse_mrl(my_vcd.player.default_vcd_device, test_mrl, - intended_vcd_device, &itemid, - my_vcd.player.default_autoplay)) + intended_vcd_device, &itemid, + my_vcd.player.default_autoplay, &used_default)) return NULL; free(my_vcd.mrl); @@ -1410,10 +1422,20 @@ return NULL; } - if (VCDINFO_ITEM_TYPE_LID == itemid.type) - my_vcd.player.cur_lid = itemid.num; - else - my_vcd.player.cur_lid = VCDINFO_INVALID_ENTRY; + + /* Do we set PBC (via LID) on? */ + my_vcd.player.cur_lid = + ( VCDINFO_ITEM_TYPE_LID == itemid.type + && my_vcd.player.num_LIDs > itemid.num ) + ? itemid.num + : VCDINFO_INVALID_ENTRY; + + if ( VCDINFO_ITEM_TYPE_LID == itemid.type && used_default) { + /* LID was selected automatically but we don't have PBC for this VCD. + So silently change LID to track and continue. + */ + itemid.type=VCDINFO_ITEM_TYPE_TRACK; + } if (0==itemid.num && VCDINFO_ITEM_TYPE_ENTRY != itemid.type) itemid.num = 1; |