Exemplo n.º 1
0
/*!
  Get the next play-item in the list given in the LIDs. Note play-item
  here refers to list of play-items for a single LID It shouldn't be
  confused with a user's list of favorite things to play or the
  "next" field of a LID which moves us to a different LID.
 */
static bool
vcdplayer_inc_play_item(access_t *p_access)
{
  vcdplayer_t *p_vcdplayer = (vcdplayer_t *)p_access->p_sys;
  int noi;

  dbg_print(INPUT_DBG_CALL, "called pli: %d", p_vcdplayer->pdi);

  if ( NULL == p_vcdplayer || NULL == p_vcdplayer->pxd.pld  )
    return false;

  noi = vcdinf_pld_get_noi(p_vcdplayer->pxd.pld);
  if ( noi <= 0 )
    return false;
 
  /* Handle delays like autowait or wait here? */

  p_vcdplayer->pdi++;

  if ( p_vcdplayer->pdi < 0 || p_vcdplayer->pdi >= noi )
    return false;

  uint16_t trans_itemid_num=vcdinf_pld_get_play_item(p_vcdplayer->pxd.pld,
                                                     p_vcdplayer->pdi);
  vcdinfo_itemid_t trans_itemid;

  if (VCDINFO_INVALID_ITEMID == trans_itemid_num) return false;
 
  vcdinfo_classify_itemid(trans_itemid_num, &trans_itemid);
  dbg_print(INPUT_DBG_PBC, "  play-item[%d]: %s",
            p_vcdplayer->pdi, vcdinfo_pin2str (trans_itemid_num));
  return vcdplayer_play_single_item(p_access, trans_itemid);
}
Exemplo n.º 2
0
/*!
  Get the next play-item in the list given in the LIDs. Note play-item
  here refers to list of play-items for a single LID It shouldn't be
  confused with a user's list of favorite things to play or the 
  "next" field of a LID which moves us to a different LID.
 */
vlc_bool_t vcdplayer_inc_play_item( input_thread_t *p_input )
{
  thread_vcd_data_t *     p_vcd= (thread_vcd_data_t *)p_input->p_access_data;

  int noi;

  dbg_print(INPUT_DBG_CALL, "called pli: %d", p_vcd->pdi);

  if ( NULL == p_vcd || NULL == p_vcd->pxd.pld  ) return VLC_FALSE;

  noi = vcdinf_pld_get_noi(p_vcd->pxd.pld);
  
  if ( noi <= 0 ) return VLC_FALSE;
  
  /* Handle delays like autowait or wait here? */

  p_vcd->pdi++;

  if ( p_vcd->pdi < 0 || p_vcd->pdi >= noi ) return VLC_FALSE;

  else {
    uint16_t trans_itemid_num=vcdinf_pld_get_play_item(p_vcd->pxd.pld, 
                                                       p_vcd->pdi);
    vcdinfo_itemid_t trans_itemid;

    if (VCDINFO_INVALID_ITEMID == trans_itemid_num) return VLC_FALSE;
    
    vcdinfo_classify_itemid(trans_itemid_num, &trans_itemid);
    dbg_print(INPUT_DBG_PBC, "  play-item[%d]: %s",
              p_vcd->pdi, vcdinfo_pin2str (trans_itemid_num));
    return VLC_SUCCESS == VCDPlay( p_input, trans_itemid );
  }
}