From: Rocky B. <ro...@us...> - 2004-01-15 00:55:24
|
Update of /cvsroot/xine/xine-vcdnav/input In directory sc8-pr-cvs1:/tmp/cvs-serv19129 Modified Files: vcdplayer.c Log Message: Made default selection dynamic. Needed for get-multi-default. Index: vcdplayer.c =================================================================== RCS file: /cvsroot/xine/xine-vcdnav/input/vcdplayer.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- vcdplayer.c 9 Sep 2003 01:35:10 -0000 1.81 +++ vcdplayer.c 15 Jan 2004 00:55:21 -0000 1.82 @@ -1,7 +1,7 @@ /* $Id$ - Copyright (C) 2002,2003 Rocky Bernstein <ro...@pa...> + Copyright (C) 2002, 2003, 2004 Rocky Bernstein <ro...@pa...> 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 @@ -311,9 +311,6 @@ _vcdplayer_update_entry(obj, vcdinf_psd_get_return_offset(this->pxd.psd), &(this->return_entry), "return"); - _vcdplayer_update_entry(obj, - vcdinfo_get_default_offset(obj, this->cur_lid), - &(this->default_entry), "default"); break; case PSD_TYPE_PLAY_LIST: if (this->pxd.pld == NULL) return; @@ -325,14 +322,13 @@ _vcdplayer_update_entry(obj, vcdinf_pld_get_return_offset(this->pxd.pld), &(this->return_entry), "return"); - this->default_entry = VCDINFO_INVALID_ENTRY; break; case PSD_TYPE_END_LIST: this->origin_lsn = this->cur_lsn = this->end_lsn = VCDINFO_NULL_LSN; /* Fall through */ case PSD_TYPE_COMMAND_LIST: - this->next_entry = this->prev_entry = this->return_entry = - this->default_entry = VCDINFO_INVALID_ENTRY; + this->next_entry = this->prev_entry = this->return_entry = + VCDINFO_INVALID_LID; break; } @@ -381,7 +377,6 @@ else this->prev_entry = VCDINFO_INVALID_ENTRY; - this->default_entry = play_item; this->return_entry = min_entry; break; @@ -790,7 +785,8 @@ unsigned int bsn=vcdinf_get_bsn(this->pxd.psd); int rand_selection=bsn + (int) ((num_selections+0.0)*rand()/(RAND_MAX+1.0)); - lid_t rand_lid=vcdplayer_selection2lid (this, rand_selection); + lid_t rand_lid=vcdinfo_selection_get_lid(this->vcd, this->cur_lid, + rand_selection); itemid.num = rand_lid; itemid.type = VCDINFO_ITEM_TYPE_LID; dbg_print(INPUT_DBG_PBC, "random selection %d, lid: %d\n", @@ -845,7 +841,6 @@ return READ_END; break; case VCDINFO_ITEM_TYPE_SPAREID2: - printf("SPAREID2\n"); if (this->in_still) { RETURN_NULL_STILL ; /* Hack: Just go back and do still again */ @@ -971,61 +966,6 @@ return; } -lid_t -vcdplayer_selection2lid (vcdplayer_input_t *this, int entry_num) -{ - /* FIXME: Some of this probably gets moved to vcdinfo. */ - /* Convert selection number to lid and then entry number...*/ - unsigned int offset; - unsigned int bsn=vcdinf_get_bsn(this->pxd.psd); - vcdinfo_obj_t *obj = this->vcd; - - dbg_print( (INPUT_DBG_CALL|INPUT_DBG_PBC), - "Called lid %u, entry_num %d bsn %d\n", this->cur_lid, - entry_num, bsn); - - if ( (entry_num - bsn + 1) > 0) { - offset = vcdinfo_lid_get_offset(obj, this->cur_lid, entry_num-bsn+1); - } else { - LOG_ERR(this, "Selection number %u too small. bsn %u\n", - entry_num, bsn); - return VCDINFO_INVALID_LID; - } - - if (offset != VCDINFO_INVALID_OFFSET) { - vcdinfo_offset_t *ofs; - int old = entry_num; - - switch (offset) { - case PSD_OFS_DISABLED: - LOG_ERR(this, "Selection %u disabled\n", entry_num); - return VCDINFO_INVALID_LID; - case PSD_OFS_MULTI_DEF: - LOG_ERR(this, "Selection %u multi_def\n", entry_num); - return VCDINFO_INVALID_LID; - case PSD_OFS_MULTI_DEF_NO_NUM: - LOG_ERR(this, "Selection %u multi_def_no_num\n", entry_num); - return VCDINFO_INVALID_LID; - default: ; - } - - ofs = vcdinfo_get_offset_t(obj, offset); - - if (NULL == ofs) { - LOG_ERR(this, "error in vcdinfo_get_offset\n"); - return -1; - } - dbg_print(INPUT_DBG_PBC, - "entry %u turned into selection lid %u\n", - old, ofs->lid); - return ofs->lid; - - } else { - LOG_ERR(this, "invalid or unset entry %u\n", entry_num); - return VCDINFO_INVALID_LID; - } -} - /* * Local variables: * c-file-style: "gnu" |