Commit 6c4b8e5a authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* vcdx Coding style fixes.

parent a3c3b3a8
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* cdrom.c: cdrom tools * cdrom.c: cdrom tools
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: cdrom.c,v 1.1 2003/10/04 18:55:13 gbazin Exp $ * $Id$
* *
* Authors: Johan Bilien <jobi@via.ecp.fr> * Authors: Johan Bilien <jobi@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -134,12 +134,12 @@ int ioctl_ReadSector( vlc_object_t *p_this, const cddev_t *p_cddev, ...@@ -134,12 +134,12 @@ int ioctl_ReadSector( vlc_object_t *p_this, const cddev_t *p_cddev,
} vcdsector_t; } vcdsector_t;
vcdsector_t vcd_sector; vcdsector_t vcd_sector;
if (cdio_read_mode2_sector(p_cddev->cdio, &vcd_sector, i_sector, true) if( cdio_read_mode2_sector(p_cddev->cdio, &vcd_sector, i_sector, VLC_TRUE)
!= 0) != 0)
{ {
// msg_Err( p_this, "Could not read sector %d", i_sector ); // msg_Err( p_this, "Could not read sector %d", i_sector );
return -1; return -1;
} }
memcpy (p_buffer, vcd_sector.data, M2F2_SECTOR_SIZE); memcpy (p_buffer, vcd_sector.data, M2F2_SECTOR_SIZE);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* using libcdio, libvcd and libvcdinfo * using libcdio, libvcd and libvcdinfo
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: vcd.h,v 1.4 2003/11/26 02:41:02 rocky Exp $ * $Id$
* *
* Authors: Rocky Bernstein <rocky@panix.com> * Authors: Rocky Bernstein <rocky@panix.com>
* *
...@@ -40,7 +40,7 @@ typedef struct ...@@ -40,7 +40,7 @@ typedef struct
#endif #endif
int i_still_time; int i_still_time;
bool b_end_of_cell; vlc_bool_t b_end_of_cell;
#if FINISHED #if FINISHED
vcdplay_event_t event; vcdplay_event_t event;
......
...@@ -48,16 +48,14 @@ ...@@ -48,16 +48,14 @@
#endif #endif
/*! /*!
Return true if playback control (PBC) is on Return VLC_TRUE if playback control (PBC) is on
*/ */
bool vlc_bool_t vcdplayer_pbc_is_on( const thread_vcd_data_t *p_vcd )
vcdplayer_pbc_is_on(const thread_vcd_data_t *p_vcd)
{ {
return VCDINFO_INVALID_ENTRY != p_vcd->cur_lid; return VCDINFO_INVALID_ENTRY != p_vcd->cur_lid;
} }
static void static void vcdplayer_update_entry( input_thread_t * p_input, uint16_t ofs,
vcdplayer_update_entry( input_thread_t * p_input, uint16_t ofs,
uint16_t *entry, const char *label) uint16_t *entry, const char *label)
{ {
thread_vcd_data_t * p_vcd= (thread_vcd_data_t *)p_input->p_access_data; thread_vcd_data_t * p_vcd= (thread_vcd_data_t *)p_input->p_access_data;
...@@ -79,10 +77,9 @@ vcdplayer_update_entry( input_thread_t * p_input, uint16_t ofs, ...@@ -79,10 +77,9 @@ vcdplayer_update_entry( input_thread_t * p_input, uint16_t ofs,
The navigations rules here may be sort of made up, but the intent The navigations rules here may be sort of made up, but the intent
is to do something that's probably right or helpful. is to do something that's probably right or helpful.
return true if the caller should return. return VLC_TRUE if the caller should return.
*/ */
vcdplayer_read_status_t vcdplayer_read_status_t vcdplayer_non_pbc_nav ( input_thread_t * p_input )
vcdplayer_non_pbc_nav ( input_thread_t * p_input )
{ {
thread_vcd_data_t * p_vcd= (thread_vcd_data_t *)p_input->p_access_data; thread_vcd_data_t * p_vcd= (thread_vcd_data_t *)p_input->p_access_data;
...@@ -260,8 +257,7 @@ vcdplayer_pbc_nav ( input_thread_t * p_input ) ...@@ -260,8 +257,7 @@ vcdplayer_pbc_nav ( input_thread_t * p_input )
confused with a user's list of favorite things to play or the 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. "next" field of a LID which moves us to a different LID.
*/ */
bool vlc_bool_t vcdplayer_inc_play_item( input_thread_t *p_input )
vcdplayer_inc_play_item( input_thread_t *p_input )
{ {
thread_vcd_data_t * p_vcd= (thread_vcd_data_t *)p_input->p_access_data; thread_vcd_data_t * p_vcd= (thread_vcd_data_t *)p_input->p_access_data;
...@@ -269,24 +265,24 @@ vcdplayer_inc_play_item( input_thread_t *p_input ) ...@@ -269,24 +265,24 @@ vcdplayer_inc_play_item( input_thread_t *p_input )
dbg_print(INPUT_DBG_CALL, "called pli: %d", p_vcd->pdi); dbg_print(INPUT_DBG_CALL, "called pli: %d", p_vcd->pdi);
if ( NULL == p_vcd || NULL == p_vcd->pxd.pld ) return false; if ( NULL == p_vcd || NULL == p_vcd->pxd.pld ) return VLC_FALSE;
noi = vcdinf_pld_get_noi(p_vcd->pxd.pld); noi = vcdinf_pld_get_noi(p_vcd->pxd.pld);
if ( noi <= 0 ) return false; if ( noi <= 0 ) return VLC_FALSE;
/* Handle delays like autowait or wait here? */ /* Handle delays like autowait or wait here? */
p_vcd->pdi++; p_vcd->pdi++;
if ( p_vcd->pdi < 0 || p_vcd->pdi >= noi ) return false; if ( p_vcd->pdi < 0 || p_vcd->pdi >= noi ) return VLC_FALSE;
else { else {
uint16_t trans_itemid_num=vcdinf_pld_get_play_item(p_vcd->pxd.pld, uint16_t trans_itemid_num=vcdinf_pld_get_play_item(p_vcd->pxd.pld,
p_vcd->pdi); p_vcd->pdi);
vcdinfo_itemid_t trans_itemid; vcdinfo_itemid_t trans_itemid;
if (VCDINFO_INVALID_ITEMID == trans_itemid_num) return false; if (VCDINFO_INVALID_ITEMID == trans_itemid_num) return VLC_FALSE;
vcdinfo_classify_itemid(trans_itemid_num, &trans_itemid); vcdinfo_classify_itemid(trans_itemid_num, &trans_itemid);
dbg_print(INPUT_DBG_PBC, " play-item[%d]: %s", dbg_print(INPUT_DBG_PBC, " play-item[%d]: %s",
...@@ -298,10 +294,9 @@ vcdplayer_inc_play_item( input_thread_t *p_input ) ...@@ -298,10 +294,9 @@ vcdplayer_inc_play_item( input_thread_t *p_input )
/*! /*!
Play item assocated with the "default" selection. Play item assocated with the "default" selection.
Return false if there was some problem. Return VLC_FALSE if there was some problem.
*/ */
bool vlc_bool_t vcdplayer_play_default( input_thread_t * p_input )
vcdplayer_play_default( input_thread_t * p_input )
{ {
thread_vcd_data_t *p_vcd= (thread_vcd_data_t *)p_input->p_access_data; thread_vcd_data_t *p_vcd= (thread_vcd_data_t *)p_input->p_access_data;
...@@ -339,7 +334,7 @@ vcdplayer_play_default( input_thread_t * p_input ) ...@@ -339,7 +334,7 @@ vcdplayer_play_default( input_thread_t * p_input )
switch (p_vcd->pxd.descriptor_type) { switch (p_vcd->pxd.descriptor_type) {
case PSD_TYPE_SELECTION_LIST: case PSD_TYPE_SELECTION_LIST:
case PSD_TYPE_EXT_SELECTION_LIST: case PSD_TYPE_EXT_SELECTION_LIST:
if (p_vcd->pxd.psd == NULL) return false; if (p_vcd->pxd.psd == NULL) return VLC_FALSE;
vcdplayer_update_entry( p_input, vcdplayer_update_entry( p_input,
vcdinfo_get_default_offset(p_vcd->vcd, vcdinfo_get_default_offset(p_vcd->vcd,
p_vcd->cur_lid), p_vcd->cur_lid),
...@@ -350,7 +345,7 @@ vcdplayer_play_default( input_thread_t * p_input ) ...@@ -350,7 +345,7 @@ vcdplayer_play_default( input_thread_t * p_input )
case PSD_TYPE_END_LIST: case PSD_TYPE_END_LIST:
case PSD_TYPE_COMMAND_LIST: case PSD_TYPE_COMMAND_LIST:
LOG_WARN( "There is no PBC 'default' selection here" ); LOG_WARN( "There is no PBC 'default' selection here" );
return false; return VLC_FALSE;
} }
#endif /* LIBVCD_VERSION (< 0.7.21) */ #endif /* LIBVCD_VERSION (< 0.7.21) */
...@@ -372,17 +367,16 @@ vcdplayer_play_default( input_thread_t * p_input ) ...@@ -372,17 +367,16 @@ vcdplayer_play_default( input_thread_t * p_input )
/*! /*!
Play item assocated with the "next" selection. Play item assocated with the "next" selection.
Return false if there was some problem. Return VLC_FALSE if there was some problem.
*/ */
bool vlc_bool_t vcdplayer_play_next( input_thread_t * p_input )
vcdplayer_play_next( input_thread_t * p_input )
{ {
thread_vcd_data_t *p_vcd= (thread_vcd_data_t *)p_input->p_access_data; thread_vcd_data_t *p_vcd= (thread_vcd_data_t *)p_input->p_access_data;
vcdinfo_obj_t *obj; vcdinfo_obj_t *obj;
vcdinfo_itemid_t itemid; vcdinfo_itemid_t itemid;
if (!p_vcd) return false; if (!p_vcd) return VLC_FALSE;
dbg_print( (INPUT_DBG_CALL|INPUT_DBG_PBC), dbg_print( (INPUT_DBG_CALL|INPUT_DBG_PBC),
"current: %d" , p_vcd->play_item.num); "current: %d" , p_vcd->play_item.num);
...@@ -398,7 +392,7 @@ vcdplayer_play_next( input_thread_t * p_input ) ...@@ -398,7 +392,7 @@ vcdplayer_play_next( input_thread_t * p_input )
switch (p_vcd->pxd.descriptor_type) { switch (p_vcd->pxd.descriptor_type) {
case PSD_TYPE_SELECTION_LIST: case PSD_TYPE_SELECTION_LIST:
case PSD_TYPE_EXT_SELECTION_LIST: case PSD_TYPE_EXT_SELECTION_LIST:
if (p_vcd->pxd.psd == NULL) return false; if (p_vcd->pxd.psd == NULL) return VLC_FALSE;
vcdplayer_update_entry( p_input, vcdplayer_update_entry( p_input,
vcdinf_psd_get_next_offset(p_vcd->pxd.psd), vcdinf_psd_get_next_offset(p_vcd->pxd.psd),
&itemid.num, "next"); &itemid.num, "next");
...@@ -406,7 +400,7 @@ vcdplayer_play_next( input_thread_t * p_input ) ...@@ -406,7 +400,7 @@ vcdplayer_play_next( input_thread_t * p_input )
break; break;
case PSD_TYPE_PLAY_LIST: case PSD_TYPE_PLAY_LIST:
if (p_vcd->pxd.pld == NULL) return false; if (p_vcd->pxd.pld == NULL) return VLC_FALSE;
vcdplayer_update_entry( p_input, vcdplayer_update_entry( p_input,
vcdinf_pld_get_next_offset(p_vcd->pxd.pld), vcdinf_pld_get_next_offset(p_vcd->pxd.pld),
&itemid.num, "next"); &itemid.num, "next");
...@@ -416,7 +410,7 @@ vcdplayer_play_next( input_thread_t * p_input ) ...@@ -416,7 +410,7 @@ vcdplayer_play_next( input_thread_t * p_input )
case PSD_TYPE_END_LIST: case PSD_TYPE_END_LIST:
case PSD_TYPE_COMMAND_LIST: case PSD_TYPE_COMMAND_LIST:
LOG_WARN( "There is no PBC 'next' selection here" ); LOG_WARN( "There is no PBC 'next' selection here" );
return false; return VLC_FALSE;
} }
} else { } else {
...@@ -446,7 +440,7 @@ vcdplayer_play_next( input_thread_t * p_input ) ...@@ -446,7 +440,7 @@ vcdplayer_play_next( input_thread_t * p_input )
itemid.num = p_vcd->play_item.num+1; itemid.num = p_vcd->play_item.num+1;
} else { } else {
LOG_WARN( "At the end - non-PBC 'next' not possible here" ); LOG_WARN( "At the end - non-PBC 'next' not possible here" );
return false; return VLC_FALSE;
} }
break; break;
...@@ -455,10 +449,10 @@ vcdplayer_play_next( input_thread_t * p_input ) ...@@ -455,10 +449,10 @@ vcdplayer_play_next( input_thread_t * p_input )
{ {
/* Should have handled above. */ /* Should have handled above. */
LOG_WARN( "Internal inconsistency - should not have gotten here." ); LOG_WARN( "Internal inconsistency - should not have gotten here." );
return false; return VLC_FALSE;
} }
default: default:
return false; return VLC_FALSE;
} }
} }
...@@ -470,10 +464,9 @@ vcdplayer_play_next( input_thread_t * p_input ) ...@@ -470,10 +464,9 @@ vcdplayer_play_next( input_thread_t * p_input )
/*! /*!
Play item assocated with the "prev" selection. Play item assocated with the "prev" selection.
Return false if there was some problem. Return VLC_FALSE if there was some problem.
*/ */
bool vlc_bool_t vcdplayer_play_prev( input_thread_t * p_input )
vcdplayer_play_prev( input_thread_t * p_input )
{ {
thread_vcd_data_t *p_vcd= (thread_vcd_data_t *)p_input->p_access_data; thread_vcd_data_t *p_vcd= (thread_vcd_data_t *)p_input->p_access_data;
...@@ -492,7 +485,7 @@ vcdplayer_play_prev( input_thread_t * p_input ) ...@@ -492,7 +485,7 @@ vcdplayer_play_prev( input_thread_t * p_input )
switch (p_vcd->pxd.descriptor_type) { switch (p_vcd->pxd.descriptor_type) {
case PSD_TYPE_SELECTION_LIST: case PSD_TYPE_SELECTION_LIST:
case PSD_TYPE_EXT_SELECTION_LIST: case PSD_TYPE_EXT_SELECTION_LIST:
if (p_vcd->pxd.psd == NULL) return false; if (p_vcd->pxd.psd == NULL) return VLC_FALSE;
vcdplayer_update_entry( p_input, vcdplayer_update_entry( p_input,
vcdinf_psd_get_prev_offset(p_vcd->pxd.psd), vcdinf_psd_get_prev_offset(p_vcd->pxd.psd),
&itemid.num, "prev"); &itemid.num, "prev");
...@@ -500,7 +493,7 @@ vcdplayer_play_prev( input_thread_t * p_input ) ...@@ -500,7 +493,7 @@ vcdplayer_play_prev( input_thread_t * p_input )
break; break;
case PSD_TYPE_PLAY_LIST: case PSD_TYPE_PLAY_LIST:
if (p_vcd->pxd.pld == NULL) return false; if (p_vcd->pxd.pld == NULL) return VLC_FALSE;
vcdplayer_update_entry( p_input, vcdplayer_update_entry( p_input,
vcdinf_pld_get_prev_offset(p_vcd->pxd.pld), vcdinf_pld_get_prev_offset(p_vcd->pxd.pld),
&itemid.num, "prev"); &itemid.num, "prev");
...@@ -510,7 +503,7 @@ vcdplayer_play_prev( input_thread_t * p_input ) ...@@ -510,7 +503,7 @@ vcdplayer_play_prev( input_thread_t * p_input )
case PSD_TYPE_END_LIST: case PSD_TYPE_END_LIST:
case PSD_TYPE_COMMAND_LIST: case PSD_TYPE_COMMAND_LIST:
LOG_WARN( "There is no PBC 'prev' selection here" ); LOG_WARN( "There is no PBC 'prev' selection here" );
return false; return VLC_FALSE;
} }
} else { } else {
...@@ -523,7 +516,7 @@ vcdplayer_play_prev( input_thread_t * p_input ) ...@@ -523,7 +516,7 @@ vcdplayer_play_prev( input_thread_t * p_input )
itemid.num = p_vcd->play_item.num-1; itemid.num = p_vcd->play_item.num-1;
} else { } else {
LOG_WARN( "At the beginning - non-PBC 'prev' not possible here" ); LOG_WARN( "At the beginning - non-PBC 'prev' not possible here" );
return false; return VLC_FALSE;
} }
} }
...@@ -536,10 +529,9 @@ vcdplayer_play_prev( input_thread_t * p_input ) ...@@ -536,10 +529,9 @@ vcdplayer_play_prev( input_thread_t * p_input )
/*! /*!
Play item assocated with the "return" selection. Play item assocated with the "return" selection.
Return false if there was some problem. Return VLC_FALSE if there was some problem.
*/ */
bool vlc_bool_t vcdplayer_play_return( input_thread_t * p_input )
vcdplayer_play_return( input_thread_t * p_input )
{ {
thread_vcd_data_t *p_vcd= (thread_vcd_data_t *)p_input->p_access_data; thread_vcd_data_t *p_vcd= (thread_vcd_data_t *)p_input->p_access_data;
...@@ -558,7 +550,7 @@ vcdplayer_play_return( input_thread_t * p_input ) ...@@ -558,7 +550,7 @@ vcdplayer_play_return( input_thread_t * p_input )
switch (p_vcd->pxd.descriptor_type) { switch (p_vcd->pxd.descriptor_type) {
case PSD_TYPE_SELECTION_LIST: case PSD_TYPE_SELECTION_LIST:
case PSD_TYPE_EXT_SELECTION_LIST: case PSD_TYPE_EXT_SELECTION_LIST:
if (p_vcd->pxd.psd == NULL) return false; if (p_vcd->pxd.psd == NULL) return VLC_FALSE;
vcdplayer_update_entry( p_input, vcdplayer_update_entry( p_input,
vcdinf_psd_get_return_offset(p_vcd->pxd.psd), vcdinf_psd_get_return_offset(p_vcd->pxd.psd),
&itemid.num, "return"); &itemid.num, "return");
...@@ -566,7 +558,7 @@ vcdplayer_play_return( input_thread_t * p_input ) ...@@ -566,7 +558,7 @@ vcdplayer_play_return( input_thread_t * p_input )
break; break;
case PSD_TYPE_PLAY_LIST: case PSD_TYPE_PLAY_LIST:
if (p_vcd->pxd.pld == NULL) return false; if (p_vcd->pxd.pld == NULL) return VLC_FALSE;
vcdplayer_update_entry( p_input, vcdplayer_update_entry( p_input,
vcdinf_pld_get_return_offset(p_vcd->pxd.pld), vcdinf_pld_get_return_offset(p_vcd->pxd.pld),
&itemid.num, "return"); &itemid.num, "return");
...@@ -576,7 +568,7 @@ vcdplayer_play_return( input_thread_t * p_input ) ...@@ -576,7 +568,7 @@ vcdplayer_play_return( input_thread_t * p_input )
case PSD_TYPE_END_LIST: case PSD_TYPE_END_LIST:
case PSD_TYPE_COMMAND_LIST: case PSD_TYPE_COMMAND_LIST:
LOG_WARN( "There is no PBC 'return' selection here" ); LOG_WARN( "There is no PBC 'return' selection here" );
return false; return VLC_FALSE;
} }
} else { } else {
......
...@@ -65,8 +65,8 @@ typedef enum { ...@@ -65,8 +65,8 @@ typedef enum {
typedef struct thread_vcd_data_s typedef struct thread_vcd_data_s
{ {
vcdinfo_obj_t *vcd; /* CD device descriptor */ vcdinfo_obj_t *vcd; /* CD device descriptor */
bool in_still; /* true if in still */ vlc_bool_t in_still; /* true if in still */
bool b_svd; /* true if we have SVD info */ vlc_bool_t b_svd; /* true if we have SVD info */
unsigned int num_tracks; /* Nb of tracks (titles) */ unsigned int num_tracks; /* Nb of tracks (titles) */
unsigned int num_segments; /* Nb of segments */ unsigned int num_segments; /* Nb of segments */
unsigned int num_entries; /* Nb of entries */ unsigned int num_entries; /* Nb of entries */
...@@ -99,7 +99,7 @@ typedef struct thread_vcd_data_s ...@@ -99,7 +99,7 @@ typedef struct thread_vcd_data_s
lsn_t * p_sectors; /* Track sectors */ lsn_t * p_sectors; /* Track sectors */
lsn_t * p_entries; /* Entry points */ lsn_t * p_entries; /* Entry points */
lsn_t * p_segments; /* Segments */ lsn_t * p_segments; /* Segments */
bool b_valid_ep; /* Valid entry points flag */ vlc_bool_t b_valid_ep; /* Valid entry points flag */
vlc_bool_t b_end_of_track; /* If the end of track was reached */ vlc_bool_t b_end_of_track; /* If the end of track was reached */
int i_debug; /* Debugging mask */ int i_debug; /* Debugging mask */
...@@ -117,40 +117,40 @@ typedef struct thread_vcd_data_s ...@@ -117,40 +117,40 @@ typedef struct thread_vcd_data_s
confused with a user's list of favorite things to play or the 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. "next" field of a LID which moves us to a different LID.
*/ */
bool vcdplayer_inc_play_item( input_thread_t *p_input ); vlc_bool_t vcdplayer_inc_play_item( input_thread_t *p_input );
/*! /*!
Return true if playback control (PBC) is on Return true if playback control (PBC) is on
*/ */
bool vcdplayer_pbc_is_on(const thread_vcd_data_t *p_this); vlc_bool_t vcdplayer_pbc_is_on(const thread_vcd_data_t *p_this);
/*! /*!
Play item assocated with the "default" selection. Play item assocated with the "default" selection.
Return false if there was some problem. Return false if there was some problem.
*/ */
bool vcdplayer_play_default( input_thread_t * p_input ); vlc_bool_t vcdplayer_play_default( input_thread_t * p_input );
/*! /*!
Play item assocated with the "next" selection. Play item assocated with the "next" selection.
Return false if there was some problem. Return false if there was some problem.
*/ */
bool vcdplayer_play_next( input_thread_t * p_input ); vlc_bool_t vcdplayer_play_next( input_thread_t * p_input );
/*! /*!
Play item assocated with the "prev" selection. Play item assocated with the "prev" selection.
Return false if there was some problem. Return false if there was some problem.
*/ */
bool vcdplayer_play_prev( input_thread_t * p_input ); vlc_bool_t vcdplayer_play_prev( input_thread_t * p_input );
/*! /*!
Play item assocated with the "return" selection. Play item assocated with the "return" selection.
Return false if there was some problem. Return false if there was some problem.
*/ */
bool vlc_bool_t
vcdplayer_play_return( input_thread_t * p_input ); vcdplayer_play_return( input_thread_t * p_input );
vcdplayer_read_status_t vcdplayer_pbc_nav ( input_thread_t * p_input ); vcdplayer_read_status_t vcdplayer_pbc_nav ( input_thread_t * p_input );
......
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