From: Rocky B. <ro...@us...> - 2002-08-16 18:27:04
|
Update of /cvsroot/xine/xine-vcdnav/input In directory usw-pr-cvs1:/tmp/cvs-serv11854 Modified Files: vcdplayer.c vcdplayer.h xineplug_inp_vcd.c Log Message: Bug fix: first play-item in playlist now works. New Feature: can now show rejected LIDs. (It might assist in PBC testing) Index: vcdplayer.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/input/vcdplayer.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- vcdplayer.c 16 Aug 2002 03:53:13 -0000 1.11 +++ vcdplayer.c 16 Aug 2002 18:27:01 -0000 1.12 @@ -298,7 +298,7 @@ /*! * parses a MRL which has the format * - * vcdx://[vcd_path][:[EPTS]?number] + * vcdx://[vcd_path][:[EPTS]?number]\*? * * Examples * vcdx:// - Play (navigate) default device: /dev/cdrom @@ -311,6 +311,7 @@ * vcdx://:P1 - probably same as above * vcdx:///dev/cdrom:E1 - Play Entry id 1 from default device * vcdx://:P1 - probably same as above. + * vcdx://:P1* - probably same as above. * vcdx://:S1 - Play segment 1 from default device * vcdx://:3 - Play track 3 from default device * vcdx:///dev/cdrom2:1 - Play track 1 from /dev/cdrom2 @@ -462,9 +463,10 @@ unsigned int j; char mrl[1024]; unsigned int num_entries; + vcdinfo_obj_t *obj; /* skip VCD if already open */ - if (-1 != this->fd) return 1; + if (-1 != this->fd) return true; if (!vcdio_open(this, vcd_device)) { /* Error should have been logged in vcdio_open. If not do the below: @@ -474,7 +476,9 @@ return false; } - num_entries = vcdinfo_get_num_entries(&(this->vcd)); + + obj = &this->vcd; + num_entries = vcdinfo_get_num_entries(obj); this->num_mrls = 0; this->mrl_track_offset = -1; @@ -499,12 +503,12 @@ /* We shouldn't have to do below test. It should be in vcdinfo_get_entry_size() */ if (j+1 < num_entries) { - size = vcdinfo_get_entry_size((&this->vcd), j); + size = vcdinfo_get_entry_size(obj, j); } else { /* FIXME: This should be encapsulated! */ - unsigned int track = vcdinfo_get_track((&this->vcd), j) - 1; + unsigned int track = vcdinfo_get_track(obj, j) - 1; if (track != VCDINFO_INVALID_TRACK) { - msf_t this_msf = *vcdinfo_get_entry_msf(&(this->vcd), j); + msf_t this_msf = *vcdinfo_get_entry_msf(obj, j); uint32_t this_lba = msf_to_lba(&this_msf); uint32_t next_lba; @@ -530,10 +534,13 @@ /* Record MRL's for LID entries or selection entries*/ this->mrl_segment_offset = this->mrl_play_offset; if (this->vcd.lot) { - for (j=0; j<LOT_VCD_OFFSETS; j++) { - if ((uint16_from_be (this->vcd.lot->offset[j])) != PSD_OFS_DISABLED) { + const uint16_t max_lid = vcdinfo_get_max_lid(obj); + for (j=0; j<max_lid; j++) { + uint16_t ofs = uint16_from_be (this->vcd.lot->offset[j]); + if (ofs != PSD_OFS_DISABLED || this->show_rejected) { memset(&mrl, 0, sizeof (mrl)); - sprintf(mrl, "%s:P%u", MRL_PREFIX, j+1); + sprintf(mrl, "%s:P%u%s", MRL_PREFIX, j+1, + ofs == PSD_OFS_DISABLED ? "*" : ""); add_mrl_slot(this, mrl, 0); this->mrl_segment_offset++; } @@ -931,7 +938,7 @@ this->pdi++; - if ( this->pdi <= 0 + if ( this->pdi < 0 || this->pdi >= this->pxd.pld->noi ) return false; else { @@ -977,14 +984,16 @@ case PSD_TYPE_PLAY_LIST: { int i; + uint16_t trans_itemid_num; if (this->pxd.pld == NULL) return; for (i = 0; i < this->pxd.pld->noi; i++) { - uint16_t trans_itemid_num=uint16_from_be(this->pxd.pld->itemid[i]); + trans_itemid_num=uint16_from_be(this->pxd.pld->itemid[i]); vcdinfo_itemid_t trans_itemid; + trans_itemid_num=uint16_from_be(this->pxd.pld->itemid[i]); vcdinfo_classify_itemid(trans_itemid_num, &trans_itemid); /* vcdplayer_play_single_item(this, trans_itemid); */ fprintf (stdout, " play-item[%d]: %s\n", Index: vcdplayer.h =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/input/vcdplayer.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- vcdplayer.h 16 Aug 2002 03:53:13 -0000 1.10 +++ vcdplayer.h 16 Aug 2002 18:27:01 -0000 1.11 @@ -197,15 +197,16 @@ config_values_t *config; /* Pointer to XineRC config file */ /* FIXME: mane xine-independent */ - char *default_vcd_device; /* Use this if none given in mrl */ - char *autoplay_devices; /* devices to search on autoplay */ - char *title_format_str; /* Format string of GUI display + char *autoplay_devices; /* devices to search on autoplay */ + vcdinfo_item_enum_t default_autoplay; /* What type to use on autoplay */ + + char *default_vcd_device; /* Use this if none given in mrl */ + bool show_rejected; /* Show rejected LIDs? */ + char *title_format_str; /* Format string of GUI display title. */ - bool wrap_next_prev; /* Do next/prev wrap around? */ + bool wrap_next_prev; /* Do next/prev wrap around? */ vcdplayer_slider_length_t slider_length; /* Whether GUI slider is track size or entry size. */ - vcdinfo_item_enum_t default_autoplay; /* What type to use on autoplay */ - } vcdplayer_input_t; /* ---------------------------------------------------------------------- Index: xineplug_inp_vcd.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/input/xineplug_inp_vcd.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- xineplug_inp_vcd.c 16 Aug 2002 03:53:13 -0000 1.13 +++ xineplug_inp_vcd.c 16 Aug 2002 18:27:01 -0000 1.14 @@ -881,28 +881,32 @@ ---------------------------------------------------------------*/ this->config = config; - this->title_format_str = config->register_string(config, - "vcdx.title_format", - "%F - %I %N, disk %c of %C - %V %A", - "format string for display banner", -"This gives a format used in the GUI Title. Similar to the Unix date\n" -"command, there are format specifiers that start with a percent sign\n" -"for which various information is filled in dynamically. (If you want a\n" -"% to appear in the display, use %%.) The control specifiers\n" -"are given as below\n" -"\n" -"%F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD\n" -"%I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT...\n" -"%N : The current number of the above - a decimal number\n" -"%V : The volume ID\n" -"%A : The album information\n" -"%C : The VCD volume count - the number of CD's in the collection.\n" -"%c : The VCD volume num - the number of the CD in the collection.\n" -" A number between 1 and the volume count.\n" -"%% : a %\n", + + this->autoplay_devices = config->register_string(config, + "vcdx.autoplay_devices", + DEFAULT_VCD_DEVICE, + "devices to search on autoplay", + NULL, NULL, NULL); + + this->default_autoplay = (vcdinfo_item_enum_t) + config->register_range(config, + "vcdx.autoplay", + (int) VCDINFO_ITEM_TYPE_ENTRY, + 1, 2, + "Default type to use on autoplay (1=track, 2=entry) ", +"This specifies what do for the when no entry is given in a mrl for\n" +"example vcdx:// or vcdx:///dev/dvd:. The values can be 1, play the\n" +"first track (e.g. vcdx://:T1) or 2, play the first entry\n" +"(vcdx://:E0).\n" +"\n" +"The default is currently 2 play the first entry. As playback control\n" +"advances this will probably be changed to autonavigate.\n", + NULL, NULL); + + this->default_vcd_device = config->register_string(config, "vcdx.default_device", DEFAULT_VCD_DEVICE, @@ -910,17 +914,15 @@ "The default device in a MRL when none is listed. The default is /dev/cdrom.", NULL, NULL); - this->current_vcd_device = this->default_vcd_device; - this->autoplay_devices = config->register_string(config, - "vcdx.autoplay_devices", - DEFAULT_VCD_DEVICE, - "devices to search on autoplay", - NULL, - NULL, - NULL); - this->slider_length = + this->current_vcd_device = this->default_vcd_device; + +#ifdef __sun__ + check_solaris_vold_device(this); +#endif + + this->slider_length = config->register_range(config, "vcdx.length_reporting", (int) VCDPLAYER_SLIDER_LENGTH_AUTO, 0, 2, @@ -938,7 +940,7 @@ NULL, NULL); #if READAHEAD_FINISHED - config->register_bool(config, "vcdx.use_readahead", + config->register_bool(config, "vcdx.use_readahead", (int) false, "Do we use read-ahead caching?", "This " @@ -947,7 +949,43 @@ read_ahead_cb, this); #endif - this->wrap_next_prev = (bool) + this->show_rejected = (bool) + config->register_bool(config, + "vcdx.show_rejected", + (int) false, + "Show 'rejected'LIDs?", +"This setting is takes a boolean value (0 = false, 1 = true).\n" +"Some playback list IDs (LIDs) are marked a not normally showable\n" +"in a list. Setting this to configuration variable to true, you can\n" +"see the value anyway. Such entries will have an asterisk (*) appended in\n" +"the MRL.\n" +"\n" +"The default is 0 - don't show such 'rejected' LIDs.\n", + NULL, NULL); + + this->title_format_str = config->register_string(config, + "vcdx.title_format", + "%F - %I %N, disk %c of %C - %V %A", + "format string for display banner", +"This gives a format used in the GUI Title. Similar to the Unix date\n" +"command, there are format specifiers that start with a percent sign\n" +"for which various information is filled in dynamically. (If you want a\n" +"% to appear in the display, use %%.) The control specifiers\n" +"are given as below\n" +"\n" +"%F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD\n" +"%I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT...\n" +"%N : The current number of the above - a decimal number\n" +"%V : The volume ID\n" +"%A : The album information\n" +"%C : The VCD volume count - the number of CD's in the collection.\n" +"%c : The VCD volume num - the number of the CD in the collection.\n" +" A number between 1 and the volume count.\n" +"%% : a %\n", + NULL, + NULL); + + this->wrap_next_prev = (bool) config->register_bool(config, "vcdx.wrap_next_prev", (int) true, @@ -964,29 +1002,9 @@ "The default is 1 - turn wrapping on.\n", NULL, NULL); - this->default_autoplay = (vcdinfo_item_enum_t) - config->register_range(config, - "vcdx.autoplay", - (int) VCDINFO_ITEM_TYPE_ENTRY, - 1, 2, - "Default type to use on autoplay (1=track, 2=entry) ", -"This specifies what do for the when no entry is given in a mrl for\n" -"example vcdx:// or vcdx:///dev/dvd:. The values can be 1, play the\n" -"first track (e.g. vcdx://:T1) or 2, play the first entry\n" -"(vcdx://:E0).\n" -"\n" -"The default is currently 2 play the first entry. As playback control\n" -"advances this will probably be changed to autonavigate.\n", - NULL, NULL); - - -#ifdef __sun__ - check_solaris_vold_device(this); -#endif - - gl_default_vcd_log_handler = vcd_log_set_handler (_xineplug_log_handler); + gl_default_vcd_log_handler = vcd_log_set_handler (_xineplug_log_handler); - return (input_plugin_t *) this; + return (input_plugin_t *) this; } /* |