Commit ed1279a6 authored by Rocky Bernstein's avatar Rocky Bernstein

access.c: LID and Segment for non PBC (the default) needs more work.

Check for them and disable (somewhat).

vcdplayer.c: check for invalid LSN in setting origin.
parent cf7397b7
......@@ -1140,11 +1140,26 @@ static int VCDControl( access_t *p_access, int i_query, va_list args )
unsigned int i_entry =
vcdinfo_track_get_entry( p_vcdplayer->vcd, i_track);
/* FIXME! For now we are assuming titles are only
tracks and that track == title+1 */
itemid.num = i_track;
itemid.type = VCDINFO_ITEM_TYPE_TRACK;
if( i < p_vcdplayer->i_tracks )
{
/* FIXME! For now we are assuming titles are only
tracks and that track == title+1 */
itemid.num = i_track;
itemid.type = VCDINFO_ITEM_TYPE_TRACK;
}
else
{
/* FIXME! i_tracks+2 are Segments, but we need to
be able to figure out which segment of that.
i_tracks+1 is either Segments (if no LIDs) or
LIDs otherwise. Again need a way to get the LID
number. */
msg_Warn( p_access,
"Trying to set track (%u) beyond end of last track (%u).",
i+1, p_vcdplayer->i_tracks );
return VLC_EGENERIC;
}
VCDSetOrigin(p_access,
vcdinfo_get_entry_lsn(p_vcdplayer->vcd, i_entry),
i_track, &itemid );
......
......@@ -326,7 +326,6 @@ vcdplayer_play_single_item( access_t * p_access, vcdinfo_itemid_t itemid)
changed: p_vcdplayer->origin_lsn, p_vcdplayer->end_lsn
*/
/* FIXME: add parameters lsn, i_track, p_itemid and set accordingly. */
void
vcdplayer_set_origin(access_t *p_access, lsn_t i_lsn, track_t i_track,
const vcdinfo_itemid_t *p_itemid)
......@@ -334,6 +333,12 @@ vcdplayer_set_origin(access_t *p_access, lsn_t i_lsn, track_t i_track,
vcdplayer_t *p_vcdplayer = (vcdplayer_t *)p_access->p_sys;
const size_t i_size= vcdplayer_get_item_size(p_access, *p_itemid);
if( VCDINFO_NULL_LSN == i_lsn )
{
LOG_ERR("%s %d", "Invalid LSN for track", i_track);
return;
}
p_vcdplayer->play_item.num = p_itemid->num;
p_vcdplayer->play_item.type = p_itemid->type;
p_vcdplayer->i_lsn = i_lsn;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment