diff options
-rw-r--r-- | src/input/vcd/vcdplayer.c | 17 | ||||
-rw-r--r-- | src/input/vcd/xineplug_inp_vcd.c | 46 |
2 files changed, 53 insertions, 10 deletions
diff --git a/src/input/vcd/vcdplayer.c b/src/input/vcd/vcdplayer.c index c2ea8e6cd..0e2685726 100644 --- a/src/input/vcd/vcdplayer.c +++ b/src/input/vcd/vcdplayer.c @@ -1,7 +1,7 @@ /* - $Id: vcdplayer.c,v 1.4 2004/03/11 08:08:48 rockyb Exp $ + $Id: vcdplayer.c,v 1.5 2004/03/31 10:13:00 rockyb Exp $ - Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com> + Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -795,7 +795,15 @@ vcdplayer_pbc_nav (vcdplayer_input_t *this, uint8_t *buf) unsigned int bsn=vcdinf_get_bsn(this->pxd.psd); int rand_selection=bsn + (int) ((num_selections+0.0)*rand()/(RAND_MAX+1.0)); + +#if defined(LIBVCD_VERSION) + /* version 0.7.21 or greater */ + lid_t rand_lid=vcdinfo_selection_get_lid(this->vcd, this->cur_lid, + rand_selection); +#else lid_t rand_lid=vcdplayer_selection2lid (this, rand_selection); +#endif /* LIBVCD_VERSION */ + itemid.num = rand_lid; itemid.type = VCDINFO_ITEM_TYPE_LID; dbg_print(INPUT_DBG_PBC, "random selection %d, lid: %d\n", @@ -935,7 +943,6 @@ vcdplayer_read (vcdplayer_input_t *this, uint8_t *buf, const off_t nlen) uint8_t subheader [8]; uint8_t data [M2F2_SECTOR_SIZE]; uint8_t spare [4]; - } vcdsector_t; vcdsector_t vcd_sector; @@ -978,6 +985,9 @@ vcdplayer_send_button_update(vcdplayer_input_t *this, const int mode) return; } +#ifndef LIBVCD_VERSION +/* Older version of vcdimager. You really should consider using 0.7.21 + or later as that has bug and memory leak fixes. */ lid_t vcdplayer_selection2lid (vcdplayer_input_t *this, int entry_num) { @@ -1032,6 +1042,7 @@ vcdplayer_selection2lid (vcdplayer_input_t *this, int entry_num) return VCDINFO_INVALID_LID; } } +#endif /* LIBVCD_VERSION */ /* * Local variables: diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c index 8394537e5..ab4984fd9 100644 --- a/src/input/vcd/xineplug_inp_vcd.c +++ b/src/input/vcd/xineplug_inp_vcd.c @@ -1,5 +1,5 @@ /* - $Id: xineplug_inp_vcd.c,v 1.13 2004/03/24 04:25:06 rockyb Exp $ + $Id: xineplug_inp_vcd.c,v 1.14 2004/03/31 10:13:00 rockyb Exp $ Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com> @@ -1012,27 +1012,53 @@ vcd_handle_events (void) switch (event->type) { case XINE_EVENT_INPUT_MENU1: if (this->return_entry == VCDINFO_INVALID_ENTRY) { - LOG_MSG("%s\n", _("selection has no return entry")); + LOG_MSG("%s\n", _("selection has no RETURN entry")); return false; } itemid.num = this->return_entry; - dbg_print(INPUT_DBG_PBC, "RETURN to %d\n", itemid.num); + dbg_print((INPUT_DBG_PBC|INPUT_DBG_EVENT), + "RETURN to %d\n", itemid.num); /* Don't loop around -- doesn't make sense to loop a return*/ num = 0; break; case XINE_EVENT_INPUT_MENU2: +#if defined(LIBVCD_VERSION) + if (vcdplayer_pbc_is_on(this)) { + lid_t lid=vcdinfo_get_multi_default_lid(this->vcd, this->cur_lid, + this->cur_lsn); + if (VCDINFO_INVALID_LID != lid) { + itemid.num = lid; + dbg_print((INPUT_DBG_PBC|INPUT_DBG_EVENT), + "DEFAULT to %d\n", itemid.num); + } else { + dbg_print((INPUT_DBG_PBC|INPUT_DBG_EVENT), + "no DEFAULT for LID %d\n", + this->cur_lid); + } + + /* Don't loop around -- doesn't make sense to loop a return*/ + num = 0; + } else { + /* PBC is not on. "default" selection beginning of current + selection . Alternative: */ + LOG_MSG("%s\n", _("DeFAULT selected but PBC is not on.")); + ; + } +#else if (this->default_entry == VCDINFO_INVALID_ENTRY) { - LOG_MSG("%s\n", _("selection has no default entry")); + LOG_MSG("%s\n", _("selection has no DEFAULT entry")); return false; } itemid.num = this->default_entry; - dbg_print(INPUT_DBG_PBC, "DEFAULT to %d\n", itemid.num); + dbg_print((INPUT_DBG_PBC|INPUT_DBG_EVENT), + "DEFAULT to %d\n", itemid.num); /* Don't loop around -- doesn't make sense to loop a return*/ num = 0; +#endif /* LIBVCD_VERSION */ break; case XINE_EVENT_INPUT_NEXT: if (this->next_entry == VCDINFO_INVALID_ENTRY) { - LOG_MSG("%s\n", _("selection has no next entry")); + LOG_MSG("%s\n", _("selection has no NEXT entry")); return false; } itemid.num = this->next_entry; @@ -1040,7 +1066,7 @@ vcd_handle_events (void) break; case XINE_EVENT_INPUT_PREVIOUS: if (this->prev_entry == VCDINFO_INVALID_ENTRY) { - LOG_MSG("%s\n", _("selection has no previous entry")); + LOG_MSG("%s\n", _("selection has no PREVIOUS entry")); return false; } itemid.num = this->prev_entry; @@ -1065,7 +1091,13 @@ vcd_handle_events (void) number_addend = 0; if (vcdplayer_pbc_is_on(this)) { +#if defined(LIBVCD_VERSION) + /* version 0.7.21 or greater */ + lid_t next_num=vcdinfo_selection_get_lid(this->vcd, this->cur_lid, + itemid.num); +#else lid_t next_num=vcdplayer_selection2lid(this, itemid.num); +#endif /* LIBVCD_VERSION */ if (VCDINFO_INVALID_LID != next_num) { itemid.num = next_num; _x_demux_flush_engine(my_vcd.stream); |