Changeset e2bc9a538ea717487c2ccf7e7f1d55c95721feda

Show
Ignore:
Timestamp:
22/12/04 12:18:11 (4 years ago)
Author:
Rocky Bernstein <rocky@videolan.org>
git-committer:
Rocky Bernstein <rocky@videolan.org> 1103714291 +0000
git-parent:

[ebcd06fd9e0bef4662c19f079f1732f3dfa3d3a0]

git-author:
Rocky Bernstein <rocky@videolan.org> 1103714291 +0000
Message:

More segment playing improvements, be able to map seekpoints to
segments and lids. Fill out vcdplayer a little more for use later.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access/vcdx/access.c

    rebcd06f re2bc9a5  
    864864    /* The last title entry is the for segments (when segments exist 
    865865       and they must here. The segment seekpoints are stored after 
    866        the entry seepoints.  
     866       the entry seekpoints and (zeroed) lid seekpoints.  
    867867    */ 
    868868    p_access->info.i_title     = p_vcd->i_titles - 1; 
    869869    p_access->info.i_size      = 150 * M2F2_SECTOR_SIZE; 
    870     p_access->info.i_seekpoint = p_vcd->i_entries + p_itemid->num; 
     870    p_access->info.i_seekpoint = p_vcd->i_entries  
     871                               + p_vcd->i_lids + p_itemid->num; 
    871872 
    872873  } 
     
    13041305        { 
    13051306            input_title_t *t = p_vcd->p_title[p_access->info.i_title]; 
    1306             i = (int)va_arg( args, int ); 
     1307            unsigned int i = (unsigned int)va_arg( args, unsigned int ); 
    13071308 
    13081309        dbg_print( INPUT_DBG_EVENT, "set seekpoint %d", i ); 
     
    13101311            { 
    13111312        track_t i_track = p_access->info.i_title+1; 
    1312  
     1313        lsn_t lsn; 
     1314         
    13131315        /* FIXME! For now we are assuming titles are only  
    13141316         tracks and that track == title+1 and we the play 
     
    13171319        */ 
    13181320 
    1319         p_vcd->play_item.num  = i; 
    1320         p_vcd->play_item.type = VCDINFO_ITEM_TYPE_ENTRY; 
    1321  
     1321        if (i < p_vcd->i_entries)  
     1322        { 
     1323            p_vcd->play_item.num  = i; 
     1324            p_vcd->play_item.type = VCDINFO_ITEM_TYPE_ENTRY; 
     1325            lsn = vcdinfo_get_entry_lba(p_vcd->vcd, i); 
     1326        } else if ( i < p_vcd->i_entries + p_vcd->i_lids )  
     1327        { 
     1328            p_vcd->play_item.num  = i = i - p_vcd->i_entries; 
     1329            p_vcd->play_item.type = VCDINFO_ITEM_TYPE_LID; 
     1330            lsn = 0; 
     1331        } else  
     1332        { 
     1333            p_vcd->play_item.num  = i = i - p_vcd->i_entries  
     1334              - p_vcd->i_lids; 
     1335            p_vcd->play_item.type = VCDINFO_ITEM_TYPE_SEGMENT; 
     1336            lsn = vcdinfo_get_seg_lsn(p_vcd->vcd, i); 
     1337        } 
     1338         
    13221339        VCDSetOrigin( p_access,  
    13231340                  vcdinfo_get_entry_lba(p_vcd->vcd, i), 
  • modules/access/vcdx/info.c

    rc7cac1b re2bc9a5  
    7272  track_t i_track; 
    7373 
    74   psz_cat = _("General"); 
     74  psz_cat = _("Disc"); 
    7575 
    7676  addstr( _("VCD Format"),  vcdinfo_get_format_version_str(p_vcd->vcd) ); 
  • modules/access/vcdx/vcdplayer.c

    rc7cac1b re2bc9a5  
    112112*/ 
    113113vcdplayer_read_status_t  
    114 vcdplayer_non_pbc_nav ( access_t * p_access ) 
     114vcdplayer_non_pbc_nav ( access_t *p_access ) 
    115115{ 
    116116  vcdplayer_t *p_vcd= (vcdplayer_t *)p_access->p_sys; 
     
    155155} 
    156156 
    157 #if FINISHED 
     157#if 1 
    158158/*! 
    159159  Set reading to play an entire track. 
     
    250250  } 
    251251} 
     252 
     253/* Play entry. */ 
     254/* Play a single item. */ 
     255static void 
     256vcdplayer_play_single_item( access_t * p_access, vcdinfo_itemid_t itemid) 
     257{ 
     258  vcdplayer_t   *p_vcd = (vcdplayer_t *)p_access->p_sys; 
     259  vcdinfo_obj_t *p_obj = p_vcd->vcd; 
     260 
     261  dbg_print(INPUT_DBG_CALL, "called itemid.num: %d, itemid.type: %d\n",  
     262            itemid.num, itemid.type); 
     263 
     264  p_vcd->in_still = 0; 
     265 
     266  switch (itemid.type) { 
     267  case VCDINFO_ITEM_TYPE_SEGMENT:  
     268    { 
     269      vcdinfo_video_segment_type_t segtype  
     270        = vcdinfo_get_video_type(p_obj, itemid.num); 
     271      segnum_t num_segs = vcdinfo_get_num_segments(p_obj); 
     272 
     273      dbg_print(INPUT_DBG_PBC, "%s (%d), itemid.num: %d\n",  
     274                vcdinfo_video_type2str(p_obj, itemid.num),  
     275                (int) segtype, itemid.num); 
     276 
     277      if (itemid.num >= num_segs) return; 
     278      _vcdplayer_set_segment(p_access, itemid.num); 
     279       
     280      switch (segtype) 
     281        { 
     282        case VCDINFO_FILES_VIDEO_NTSC_STILL: 
     283        case VCDINFO_FILES_VIDEO_NTSC_STILL2: 
     284        case VCDINFO_FILES_VIDEO_PAL_STILL: 
     285        case VCDINFO_FILES_VIDEO_PAL_STILL2: 
     286          p_vcd->in_still = -5; 
     287          break; 
     288        default: 
     289          p_vcd->in_still = 0; 
     290        } 
     291       
     292      break; 
     293    } 
     294     
     295  case VCDINFO_ITEM_TYPE_TRACK: 
     296    dbg_print(INPUT_DBG_PBC, "track %d\n", itemid.num); 
     297    if (itemid.num < 1 || itemid.num > p_vcd->i_tracks) return; 
     298    _vcdplayer_set_track(p_access, itemid.num); 
     299    break; 
     300     
     301  case VCDINFO_ITEM_TYPE_ENTRY:  
     302    { 
     303      unsigned int num_entries = vcdinfo_get_num_entries(p_obj); 
     304      dbg_print(INPUT_DBG_PBC, "entry %d\n", itemid.num); 
     305      if (itemid.num >= num_entries) return; 
     306      _vcdplayer_set_entry(p_access, itemid.num); 
     307      break; 
     308    } 
     309     
     310  case VCDINFO_ITEM_TYPE_LID: 
     311    LOG_ERR("%s\n", _("Should have converted p_vcd above")); 
     312    break; 
     313 
     314  case VCDINFO_ITEM_TYPE_NOTFOUND: 
     315    dbg_print(INPUT_DBG_PBC, "play nothing\n"); 
     316    p_vcd->i_lsn = p_vcd->end_lsn; 
     317    return; 
     318 
     319  default: 
     320    LOG_ERR("item type %d not implemented.\n", itemid.type); 
     321    return; 
     322  } 
     323   
     324  p_vcd->play_item = itemid; 
     325 
     326  /* Some players like xine, have a fifo queue of audio and video buffers 
     327     that need to be flushed when playing a new selection. */ 
     328  /*  if (p_vcd->flush_buffers) 
     329      p_vcd->flush_buffers(); */ 
     330 
     331} 
     332 
    252333#endif /* FINISHED */ 
    253334 
     
    257338   changed: p_vcd->origin_lsn, p_vcd->end_lsn 
    258339*/ 
     340 
     341/* FIXME: add parameters lsn, i_track, p_itemid and set accordingly. */ 
    259342void  
    260343vcdplayer_set_origin(access_t *p_access) 
     
    267350 
    268351  dbg_print((INPUT_DBG_CALL|INPUT_DBG_LSN), "end LSN: %u\n", p_vcd->end_lsn); 
     352} 
     353 
     354/* 
     355  Get the next play-item in the list given in the LIDs. Note play-item 
     356  here refers to list of play-items for a single LID It shouldn't be 
     357  confused with a user's list of favorite things to play or the  
     358  "next" field of a LID which moves us to a different LID. 
     359 */ 
     360static bool 
     361_vcdplayer_inc_play_item(access_t *p_access) 
     362{ 
     363  vcdplayer_t *p_vcd = (vcdplayer_t *)p_access->p_sys; 
     364  int noi; 
     365 
     366  dbg_print(INPUT_DBG_CALL, "called pli: %d\n", p_vcd->pdi); 
     367 
     368  if ( NULL == p_vcd || NULL == p_vcd->pxd.pld  ) return false; 
     369 
     370  noi = vcdinf_pld_get_noi(p_vcd->pxd.pld); 
     371   
     372  if ( noi <= 0 ) return false; 
     373   
     374  /* Handle delays like autowait or wait here? */ 
     375 
     376  p_vcd->pdi++; 
     377 
     378  if ( p_vcd->pdi < 0 || p_vcd->pdi >= noi ) return false; 
     379 
     380  else { 
     381    uint16_t trans_itemid_num=vcdinf_pld_get_play_item(p_vcd->pxd.pld,  
     382                                                       p_vcd->pdi); 
     383    vcdinfo_itemid_t trans_itemid; 
     384 
     385    if (VCDINFO_INVALID_ITEMID == trans_itemid_num) return false; 
     386     
     387    vcdinfo_classify_itemid(trans_itemid_num, &trans_itemid); 
     388    dbg_print(INPUT_DBG_PBC, "  play-item[%d]: %s\n", 
     389              p_vcd->pdi, vcdinfo_pin2str (trans_itemid_num)); 
     390    vcdplayer_play_single_item(p_access, trans_itemid); 
     391    return true; 
     392  } 
    269393} 
    270394 
     
    451575  vcdplayer_t *p_vcd= (vcdplayer_t *)p_access->p_sys; 
    452576 
    453   vcdinfo_itemid_t   itemid; 
     577  vcdinfo_itemid_t itemid; 
    454578 
    455579  if (!p_vcd) {