Commit 546b08b6 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Coding Style fixes

parent 61b7f84a
......@@ -78,52 +78,53 @@ static int CDDAInit( access_t *p_access, cdda_data_t *p_cdda ) ;
called by CDDAOpen
*/
static void
cdio_log_handler (cdio_log_level_t level, const char message[])
cdio_log_handler( cdio_log_level_t level, const char message[] )
{
cdda_data_t *p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
if( p_cdda == NULL )
return;
switch (level) {
case CDIO_LOG_DEBUG:
case CDIO_LOG_INFO:
if (p_cdda->i_debug & INPUT_DBG_CDIO)
msg_Dbg( p_cdda_input, message);
break;
case CDIO_LOG_WARN:
msg_Warn( p_cdda_input, message);
break;
case CDIO_LOG_ERROR:
case CDIO_LOG_ASSERT:
msg_Err( p_cdda_input, message);
break;
default:
msg_Warn( p_cdda_input, message,
"the above message had unknown cdio log level",
level);
}
return;
}
cdda_data_t *p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
if( p_cdda == NULL )
return;
switch( level )
{
case CDIO_LOG_DEBUG:
case CDIO_LOG_INFO:
if (p_cdda->i_debug & INPUT_DBG_CDIO)
msg_Dbg( p_cdda_input, message);
break;
case CDIO_LOG_WARN:
msg_Warn( p_cdda_input, message);
break;
case CDIO_LOG_ERROR:
case CDIO_LOG_ASSERT:
msg_Err( p_cdda_input, message);
break;
default:
msg_Warn( p_cdda_input, message,
"the above message had unknown cdio log level",
level);
break;
}
}
#ifdef HAVE_LIBCDDB
/*! This routine is called by libcddb routines on error.
called by CDDAOpen
*/
static void
cddb_log_handler (cddb_log_level_t level, const char message[])
cddb_log_handler( cddb_log_level_t level, const char message[] )
{
cdda_data_t *p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
switch (level)
switch( level )
{
case CDDB_LOG_DEBUG:
case CDDB_LOG_INFO:
if (!(p_cdda->i_debug & INPUT_DBG_CDDB)) return;
if( !(p_cdda->i_debug & INPUT_DBG_CDDB) )
return;
/* Fall through if to warn case */
default:
cdio_log_handler (level, message);
cdio_log_handler( level, message );
break;
}
}
#endif /*HAVE_LIBCDDB*/
......@@ -133,81 +134,79 @@ cddb_log_handler (cddb_log_level_t level, const char message[])
or is not around (before finalization).
*/
static void
uninit_log_handler (cdio_log_level_t level, const char message[])
uninit_log_handler( cdio_log_level_t level, const char message[] )
{
cdda_data_t *p_cdda = NULL;
if (p_cdda_input)
if( p_cdda_input )
p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
switch (level)
switch( level )
{
case CDIO_LOG_DEBUG:
case CDIO_LOG_INFO:
if (!p_cdda || !(p_cdda->i_debug & (INPUT_DBG_CDIO|INPUT_DBG_CDDB)))
return;
if( !p_cdda || !(p_cdda->i_debug & (INPUT_DBG_CDIO|INPUT_DBG_CDDB)) )
return;
/* Fall through if to warn case */
case CDIO_LOG_WARN:
fprintf(stderr, "WARN: %s\n", message);
fprintf( stderr, "WARN: %s\n", message );
break;
case CDIO_LOG_ERROR:
fprintf(stderr, "ERROR: %s\n", message);
fprintf( stderr, "ERROR: %s\n", message );
break;
case CDIO_LOG_ASSERT:
fprintf(stderr, "ASSERT ERROR: %s\n", message);
fprintf( stderr, "ASSERT ERROR: %s\n", message );
break;
default:
fprintf(stderr, "UNKNOWN ERROR: %s\n%s %d\n", message,
fprintf( stderr, "UNKNOWN ERROR: %s\n%s %d\n", message,
"The above message had unknown cdio log level",
level);
level );
break;
}
/* gl_default_cdio_log_handler (level, message); */
}
/* Only used in audio control mode. Gets the current LSN from the
CD-ROM drive. */
static int64_t
get_audio_position ( access_t *p_access )
static int64_t get_audio_position ( access_t *p_access )
{
cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys;
lsn_t i_offset;
#if LIBCDIO_VERSION_NUM >= 73
if (p_cdda->b_audio_ctl)
{
cdio_subchannel_t sub;
CdIo_t *p_cdio = p_cdda->p_cdio;
if (DRIVER_OP_SUCCESS == cdio_audio_read_subchannel(p_cdio, &sub)) {
if (sub.audio_status != CDIO_MMC_READ_SUB_ST_PAUSED &&
sub.audio_status != CDIO_MMC_READ_SUB_ST_PLAY)
return CDIO_INVALID_LSN;
if ( ! p_cdda->b_nav_mode ) {
// char *psz = cdio_msf_to_str(&sub.abs_addr);
// fprintf(stderr, "+++disk mode abs msf %s", psz);
// free(psz);
i_offset = cdio_msf_to_lba((&sub.abs_addr));
// fprintf(stderr, " frame offset %d\n", i_offset);
} else {
// char *psz = cdio_msf_to_str(&sub.rel_addr);
// fprintf(stderr, "+++track abs msf %s", psz);
// free(psz);
i_offset = cdio_msf_to_lba((&sub.rel_addr));
// fprintf(stderr, " frame offset %d\n", i_offset);
}
} else {
// fprintf(stderr, "+++Error reading current pos\n");
i_offset = p_cdda->i_lsn;
}
} else
i_offset = p_cdda->i_lsn;
#else
i_offset = p_cdda->i_lsn;
;
if( p_cdda->b_audio_ctl )
{
cdio_subchannel_t sub;
CdIo_t *p_cdio = p_cdda->p_cdio;
if( DRIVER_OP_SUCCESS == cdio_audio_read_subchannel(p_cdio, &sub) )
{
if( (sub.audio_status != CDIO_MMC_READ_SUB_ST_PAUSED) &&
(sub.audio_status != CDIO_MMC_READ_SUB_ST_PLAY) )
return CDIO_INVALID_LSN;
if( ! p_cdda->b_nav_mode )
{
i_offset = cdio_msf_to_lba( (&sub.abs_addr) );
}
else
{
i_offset = cdio_msf_to_lba( (&sub.rel_addr) );
}
}
else
{
i_offset = p_cdda->i_lsn;
}
}
else
{
i_offset = p_cdda->i_lsn;
#else
i_offset = p_cdda->i_lsn;
#endif
return i_offset;
}
return i_offset;
}
/*****************************************************************************
......@@ -222,12 +221,13 @@ static block_t * CDDAReadBlocks( access_t * p_access )
cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys;
int i_blocks = p_cdda->i_blocks_per_read;
dbg_print((INPUT_DBG_CALL|INPUT_DBG_EXT|INPUT_DBG_LSN),
"called i_lsn: %d i_pos: %lld, size: %lld",
p_cdda->i_lsn, p_access->info.i_pos, p_access->info.i_size);
dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT|INPUT_DBG_LSN),
"called i_lsn: %d i_pos: %lld, size: %lld",
p_cdda->i_lsn, p_access->info.i_pos, p_access->info.i_size );
/* Check end of file */
if( p_access->info.b_eof ) return NULL;
if( p_access->info.b_eof )
return NULL;
if( !p_cdda->b_header )
{
......@@ -239,20 +239,20 @@ static block_t * CDDAReadBlocks( access_t * p_access )
}
/* Check end of track */
while( p_cdda->i_lsn > cdio_get_track_last_lsn(p_cdda->p_cdio,
p_cdda->i_track) )
while( p_cdda->i_lsn > cdio_get_track_last_lsn(p_cdda->p_cdio,
p_cdda->i_track) )
{
bool go_on;
if( p_cdda->b_nav_mode )
go_on = p_cdda->i_lsn > p_cdda->last_disc_frame;
else
go_on = p_cdda->i_track >= p_cdda->i_first_track+p_cdda->i_titles-1 ;
if( p_cdda->b_nav_mode )
go_on = p_cdda->i_lsn > p_cdda->last_disc_frame;
else
go_on = p_cdda->i_track >= p_cdda->i_first_track+p_cdda->i_titles-1 ;
if( go_on )
{
dbg_print( (INPUT_DBG_LSN), "EOF");
p_access->info.b_eof = VLC_TRUE;
dbg_print( (INPUT_DBG_LSN), "EOF");
p_access->info.b_eof = VLC_TRUE;
return NULL;
}
......@@ -260,85 +260,92 @@ static block_t * CDDAReadBlocks( access_t * p_access )
p_access->info.i_title++;
p_cdda->i_track++;
if ( p_cdda-> b_nav_mode ) {
char *psz_title = CDDAFormatTitle( p_access, p_cdda->i_track );
input_Control( p_cdda->p_input, INPUT_SET_NAME, psz_title );
free(psz_title);
} else {
p_access->info.i_size =
p_cdda->p_title[p_access->info.i_title]->i_size;
p_access->info.i_pos = 0;
p_access->info.i_update |= INPUT_UPDATE_SIZE;
}
if( p_cdda-> b_nav_mode )
{
char *psz_title = CDDAFormatTitle( p_access, p_cdda->i_track );
input_Control( p_cdda->p_input, INPUT_SET_NAME, psz_title );
free(psz_title);
}
else
{
p_access->info.i_size =
p_cdda->p_title[p_access->info.i_title]->i_size;
p_access->info.i_pos = 0;
p_access->info.i_update |= INPUT_UPDATE_SIZE;
}
}
/* Possibly adjust i_blocks so we don't read past the end of a track. */
if( p_cdda->i_lsn + i_blocks >=
cdio_get_track_lsn(p_cdda->p_cdio, p_cdda->i_track+1) )
if( p_cdda->i_lsn + i_blocks >=
cdio_get_track_lsn(p_cdda->p_cdio, p_cdda->i_track+1) )
{
i_blocks = cdio_get_track_lsn( p_cdda->p_cdio, p_cdda->i_track+1 )
- p_cdda->i_lsn;
i_blocks = cdio_get_track_lsn( p_cdda->p_cdio, p_cdda->i_track+1 )
- p_cdda->i_lsn;
}
/* Do the actual reading */
p_block = block_New( p_access, i_blocks * CDIO_CD_FRAMESIZE_RAW );
if( !p_block)
{
msg_Err( p_access, "cannot get a new block of size: %i",
i_blocks * CDIO_CD_FRAMESIZE_RAW );
return NULL;
msg_Err( p_access, "cannot get a new block of size: %i",
i_blocks * CDIO_CD_FRAMESIZE_RAW );
return NULL;
}
{
#if LIBCDIO_VERSION_NUM >= 72
driver_return_code_t rc = DRIVER_OP_SUCCESS;
if ( p_cdda->e_paranoia && p_cdda->paranoia )
{
int i;
for( i = 0; i < i_blocks; i++ )
{
int16_t *p_readbuf = cdio_paranoia_read(p_cdda->paranoia, NULL);
char *psz_err=cdio_cddap_errors(p_cdda->paranoia_cd);
char *psz_mes=cdio_cddap_messages(p_cdda->paranoia_cd);
if (psz_mes || psz_err)
msg_Err( p_access, "%s%s\n", psz_mes ? psz_mes: "",
psz_err ? psz_err: "" );
if (psz_err) free(psz_err);
if (psz_mes) free(psz_mes);
if( !p_readbuf ) {
msg_Err( p_access, "paranoia read error on frame %i\n",
p_cdda->i_lsn+i );
} else
memcpy(p_block->p_buffer + i * CDIO_CD_FRAMESIZE_RAW,
p_readbuf, CDIO_CD_FRAMESIZE_RAW);
}
}
else
rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
p_cdda->i_lsn, i_blocks);
driver_return_code_t rc = DRIVER_OP_SUCCESS;
if( p_cdda->e_paranoia && p_cdda->paranoia )
{
int i;
for( i = 0; i < i_blocks; i++ )
{
int16_t *p_readbuf = cdio_paranoia_read( p_cdda->paranoia, NULL );
char *psz_err = cdio_cddap_errors( p_cdda->paranoia_cd );
char *psz_mes = cdio_cddap_messages( p_cdda->paranoia_cd );
if( psz_mes || psz_err )
msg_Err( p_access, "%s%s\n", psz_mes ? psz_mes: "",
psz_err ? psz_err: "" );
if( psz_err ) free( psz_err );
if( psz_mes ) free( psz_mes );
if( !p_readbuf )
{
msg_Err( p_access, "paranoia read error on frame %i\n",
p_cdda->i_lsn+i );
}
else
memcpy( p_block->p_buffer + i * CDIO_CD_FRAMESIZE_RAW,
p_readbuf, CDIO_CD_FRAMESIZE_RAW );
}
}
else
{
rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
p_cdda->i_lsn, i_blocks );
#else
#define DRIVER_OP_SUCCESS 0
int rc;
rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
p_cdda->i_lsn, i_blocks);
#endif
if( rc != DRIVER_OP_SUCCESS )
{
msg_Err( p_access, "could not read %d sectors starting from %lu",
i_blocks, (long unsigned int) p_cdda->i_lsn );
block_Release( p_block );
/* If we had problems above, assume the problem is with
the first sector of the read and set to skip it. In
the future libcdio may have cdparanoia support.
*/
p_cdda->i_lsn++;
p_access->info.i_pos += CDIO_CD_FRAMESIZE_RAW;
return NULL;
}
int rc;
rc = cdio_read_audio_sectors( p_cdda->p_cdio, p_block->p_buffer,
p_cdda->i_lsn, i_blocks);
#endif
}
if( rc != DRIVER_OP_SUCCESS )
{
msg_Err( p_access, "could not read %d sectors starting from %lu",
i_blocks, (long unsigned int) p_cdda->i_lsn );
block_Release( p_block );
/* If we had problems above, assume the problem is with
the first sector of the read and set to skip it. In
the future libcdio may have cdparanoia support.
*/
p_cdda->i_lsn++;
p_access->info.i_pos += CDIO_CD_FRAMESIZE_RAW;
return NULL;
}
}
p_cdda->i_lsn += i_blocks;
......@@ -355,86 +362,92 @@ CDDARead( access_t * p_access, uint8_t *p_buffer, int i_len )
{
cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys;
dbg_print((INPUT_DBG_CALL|INPUT_DBG_EXT|INPUT_DBG_LSN),
"called lsn: %d pos: %lld, size: %lld",
p_cdda->i_lsn, p_access->info.i_pos, p_access->info.i_size);
dbg_print( (INPUT_DBG_CALL|INPUT_DBG_EXT|INPUT_DBG_LSN),
"called lsn: %d pos: %lld, size: %lld",
p_cdda->i_lsn, p_access->info.i_pos, p_access->info.i_size);
/* Check end of file */
if( p_access->info.b_eof ) return 0;
if( p_access->info.b_eof )
return 0;
{
lsn_t i_lsn = get_audio_position(p_access);
if (CDIO_INVALID_LSN == i_lsn) {
dbg_print((INPUT_DBG_LSN), "invalid lsn");
memset( p_buffer, 0, i_len );
return i_len;
}
p_cdda->i_lsn = i_lsn;
p_access->info.i_pos = p_cdda->i_lsn * CDIO_CD_FRAMESIZE_RAW;
lsn_t i_lsn = get_audio_position(p_access);
if( CDIO_INVALID_LSN == i_lsn )
{
dbg_print( (INPUT_DBG_LSN), "invalid lsn" );
memset( p_buffer, 0, i_len );
return i_len;
}
p_cdda->i_lsn = i_lsn;
p_access->info.i_pos = p_cdda->i_lsn * CDIO_CD_FRAMESIZE_RAW;
}
dbg_print((INPUT_DBG_LSN), "updated lsn: %d", p_cdda->i_lsn);
dbg_print( (INPUT_DBG_LSN), "updated lsn: %d", p_cdda->i_lsn );
/* Check end of track */
while( p_cdda->i_lsn > cdio_get_track_last_lsn(p_cdda->p_cdio,
p_cdda->i_track) )
while( p_cdda->i_lsn > cdio_get_track_last_lsn( p_cdda->p_cdio,
p_cdda->i_track) )
{
if( p_cdda->i_track >= p_cdda->i_first_track + p_cdda->i_titles - 1 )
{
dbg_print( (INPUT_DBG_LSN), "EOF");
dbg_print( (INPUT_DBG_LSN), "EOF");
p_access->info.b_eof = VLC_TRUE;
return 0;
}
p_access->info.i_update |= INPUT_UPDATE_TITLE;
p_access->info.i_title++;
p_cdda->i_track++;
if ( p_cdda-> b_nav_mode ) {
char *psz_title = CDDAFormatTitle( p_access, p_cdda->i_track );
input_Control( p_cdda->p_input, INPUT_SET_NAME, psz_title );
free(psz_title);
} else {
p_access->info.i_size =
p_cdda->p_title[p_access->info.i_title]->i_size;
p_access->info.i_pos = 0;
p_access->info.i_update |= INPUT_UPDATE_SIZE;
}
if( p_cdda-> b_nav_mode )
{
char *psz_title = CDDAFormatTitle( p_access, p_cdda->i_track );
input_Control( p_cdda->p_input, INPUT_SET_NAME, psz_title );
free(psz_title);
}
else
{
p_access->info.i_size =
p_cdda->p_title[p_access->info.i_title]->i_size;
p_access->info.i_pos = 0;
p_access->info.i_update |= INPUT_UPDATE_SIZE;
}
}
memset( p_buffer, 0, i_len );
return i_len;
}
/*! Pause CD playing via audio control */
static bool
cdda_audio_pause(CdIo_t *p_cdio)
static bool cdda_audio_pause( CdIo_t *p_cdio )
{
bool b_ok = true;
bool b_ok = true;
#if LIBCDIO_VERSION_NUM >= 73
cdio_subchannel_t sub;
if (DRIVER_OP_SUCCESS == cdio_audio_read_subchannel(p_cdio, &sub)) {
if (sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY) {
b_ok = DRIVER_OP_SUCCESS == cdio_audio_pause(p_cdio);
cdio_subchannel_t sub;
if( DRIVER_OP_SUCCESS == cdio_audio_read_subchannel( p_cdio, &sub ) )
{
if( sub.audio_status == CDIO_MMC_READ_SUB_ST_PLAY )
{
b_ok = DRIVER_OP_SUCCESS == cdio_audio_pause(p_cdio);
}
}
} else
b_ok = false;
else
b_ok = false;
#endif
return b_ok;
return b_ok;
}
#if LIBCDIO_VERSION_NUM >= 73
/*! play CD using audio controls */
static driver_return_code_t
cdda_audio_play(CdIo_t *p_cdio, lsn_t start_lsn, lsn_t end_lsn)
cdda_audio_play( CdIo_t *p_cdio, lsn_t start_lsn, lsn_t end_lsn )
{
msf_t start_msf;
msf_t last_msf;
cdio_lsn_to_msf(start_lsn, &start_msf);
cdio_lsn_to_msf(end_lsn, &last_msf);
cdda_audio_pause(p_cdio);
return cdio_audio_play_msf (p_cdio, &start_msf, &last_msf);
msf_t start_msf;
msf_t last_msf;
cdio_lsn_to_msf( start_lsn, &start_msf );
cdio_lsn_to_msf( end_lsn, &last_msf );
cdda_audio_pause( p_cdio );
return cdio_audio_play_msf( p_cdio, &start_msf, &last_msf );
}
#endif
......@@ -442,8 +455,7 @@ cdda_audio_play(CdIo_t *p_cdio, lsn_t start_lsn, lsn_t end_lsn)
* CDDASeek - change position for subsequent reads. For example, this
* can happen if the user moves a position slider bar in a GUI.
****************************************************************************/
static int
CDDASeek( access_t * p_access, int64_t i_pos )
static int CDDASeek( access_t * p_access, int64_t i_pos )
{
cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys;
......@@ -454,48 +466,48 @@ CDDASeek( access_t * p_access, int64_t i_pos )
p_cdda->i_lsn = (i_pos / CDIO_CD_FRAMESIZE_RAW);
#if LIBCDIO_VERSION_NUM >= 72
if ( p_cdda->e_paranoia && p_cdda->paranoia )
cdio_paranoia_seek(p_cdda->paranoia, p_cdda->i_lsn, SEEK_SET);
if( p_cdda->e_paranoia && p_cdda->paranoia )
cdio_paranoia_seek( p_cdda->paranoia, p_cdda->i_lsn, SEEK_SET );
#endif
#if LIBCDIO_VERSION_NUM >= 73
if ( p_cdda->b_audio_ctl ) {
track_t i_track = cdio_get_track(p_cdda->p_cdio, p_cdda->i_lsn);
lsn_t i_last_lsn;
if( p_cdda->b_audio_ctl )
{
track_t i_track = cdio_get_track( p_cdda->p_cdio, p_cdda->i_lsn );
lsn_t i_last_lsn;
if ( p_cdda->b_nav_mode )
i_last_lsn = p_cdda->last_disc_frame;
else
i_last_lsn = cdio_get_track_last_lsn(p_cdda->p_cdio, i_track);
if( p_cdda->b_nav_mode )
i_last_lsn = p_cdda->last_disc_frame;
else
i_last_lsn = cdio_get_track_last_lsn( p_cdda->p_cdio, i_track );
cdda_audio_play(p_cdda->p_cdio, p_cdda->i_lsn, i_last_lsn);
cdda_audio_play( p_cdda->p_cdio, p_cdda->i_lsn, i_last_lsn );
}
#endif
#endif
if ( ! p_cdda->b_nav_mode )
p_cdda->i_lsn += cdio_get_track_lsn(p_cdda->p_cdio, p_cdda->i_track);
if( ! p_cdda->b_nav_mode )
p_cdda->i_lsn += cdio_get_track_lsn( p_cdda->p_cdio, p_cdda->i_track );
/* Seeked backwards and we are doing disc mode. */
if ( p_cdda->b_nav_mode && p_access->info.i_pos > i_pos ) {
track_t i_track;
char *psz_title;
for( i_track = p_cdda->i_track;
i_track > 1 &&
p_cdda->i_lsn < cdio_get_track_lsn(p_cdda->p_cdio, i_track);
i_track--, p_access->info.i_title-- ) ;
p_cdda->i_track = i_track;
p_access->info.i_update |= INPUT_UPDATE_TITLE | INPUT_UPDATE_META ;
psz_title = CDDAFormatTitle( p_access, p_cdda->i_track );
input_Control( p_cdda->p_input, INPUT_SET_NAME,
psz_title );
free(psz_title);
if( p_cdda->b_nav_mode && p_access->info.i_pos > i_pos )
{
track_t i_track;
char *psz_title;
for( i_track = p_cdda->i_track; i_track > 1 &&
p_cdda->i_lsn < cdio_get_track_lsn( p_cdda->p_cdio, i_track );
i_track--, p_access->info.i_title-- )
;
p_cdda->i_track = i_track;
p_access->info.i_update |= INPUT_UPDATE_TITLE | INPUT_UPDATE_META ;
psz_title = CDDAFormatTitle( p_access, p_cdda->i_track );
input_Control( p_cdda->p_input, INPUT_SET_NAME,
psz_title );
free( psz_title );
}
p_access->info.i_pos = i_pos;
p_access->info.i_pos = i_pos;
return VLC_SUCCESS;
}
......@@ -504,41 +516,38 @@ CDDASeek( access_t * p_access, int64_t i_pos )
If we are using audio-ctl mode we also activate CD-ROM
to play.
*/
static bool
cdda_play_track( access_t *p_access, track_t i_track )
static bool cdda_play_track( access_t *p_access, track_t i_track )
{
cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys;
dbg_print((INPUT_DBG_CALL), "called track: %d\n", i_track);
if (i_track > p_cdda->i_tracks)
{
msg_Err( p_access, "CD has %d tracks, and you requested track %d",
p_cdda->i_tracks, i_track );
return false;
}
dbg_print( (INPUT_DBG_CALL), "called track: %d\n", i_track );
if( i_track > p_cdda->i_tracks )
{
msg_Err( p_access, "CD has %d tracks, and you requested track %d",
p_cdda->i_tracks, i_track );
return false;
}
p_cdda->i_track = i_track;
/* set up the frame boundaries for this particular track */
p_cdda->first_frame = p_cdda->i_lsn =
cdio_get_track_lsn(p_cdda->p_cdio, i_track);
cdio_get_track_lsn( p_cdda->p_cdio, i_track );
p_cdda->last_frame = cdio_get_track_lsn(p_cdda->p_cdio, i_track+1) - 1;
p_cdda->last_frame = cdio_get_track_lsn( p_cdda->p_cdio, i_track+1 ) - 1;
#if LIBCDIO_VERSION_NUM >= 73
if (p_cdda->b_audio_ctl)
{
lsn_t i_last_lsn;
if ( p_cdda->b_nav_mode )
i_last_lsn = p_cdda->last_disc_frame;
else
i_last_lsn = cdio_get_track_last_lsn(p_cdda->p_cdio, i_track);
cdda_audio_play(p_cdda->p_cdio, p_cdda->i_lsn, i_last_lsn);
}
if( p_cdda->b_audio_ctl )
{
lsn_t i_last_lsn;
if( p_cdda->b_nav_mode )
i_last_lsn = p_cdda->last_disc_frame;
else
i_last_lsn = cdio_get_track_last_lsn( p_cdda->p_cdio, i_track );
cdda_audio_play( p_cdda->p_cdio, p_cdda->i_lsn, i_last_lsn );
}
#endif
return true;
return true;
}
/****************************************************************************
......@@ -549,8 +558,7 @@ cdda_play_track( access_t *p_access, track_t i_track )
* Open: open cdda device or image file and initialize structures
* for subsequent operations.
*****************************************************************************/
int