From c91e463ac3e9b7b7e71c824a39d7ca928cf61e1b Mon Sep 17 00:00:00 2001 From: Rocky Bernstein Date: Fri, 10 Dec 2004 10:10:11 +0000 Subject: [PATCH] Get stream disc information to appear again. Remove private LSN table rom cdda_t - just use it from cdio. Remove lsn from cdda. --- modules/access/cdda/access.c | 65 ++++++----- modules/access/cdda/cdda.h | 7 +- modules/access/cdda/info.c | 215 ++++++++++++++++++++--------------- modules/access/cdda/info.h | 12 +- 4 files changed, 174 insertions(+), 125 deletions(-) diff --git a/modules/access/cdda/access.c b/modules/access/cdda/access.c index d11c186fd7..0121d9aa55 100644 --- a/modules/access/cdda/access.c +++ b/modules/access/cdda/access.c @@ -191,7 +191,8 @@ static block_t * CDDAReadBlocks( access_t * p_access ) } /* Check end of track */ - while( p_cdda->i_lsn >= p_cdda->lsn[p_cdda->i_track+1] ) + while( p_cdda->i_lsn >= cdio_get_track_lsn(p_cdda->p_cdio, + p_cdda->i_track+1) ) { if( p_cdda->i_track >= p_cdda->i_first_track + p_cdda->i_titles - 1 ) { @@ -208,9 +209,11 @@ static block_t * CDDAReadBlocks( access_t * p_access ) } /* Possibly adjust i_blocks so we don't read past the end of a track. */ - if( p_cdda->i_lsn + i_blocks >= p_cdda->lsn[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 = p_cdda->lsn[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 */ @@ -252,7 +255,7 @@ static int CDDASeek( access_t * p_access, int64_t i_pos ) { cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys; - p_cdda->i_lsn = p_cdda->lsn[p_cdda->i_track] + p_cdda->i_lsn = cdio_get_track_lsn(p_cdda->p_cdio, p_cdda->i_track) + (i_pos / CDIO_CD_FRAMESIZE_RAW); p_access->info.i_pos = i_pos; @@ -370,14 +373,15 @@ int E_(CDDAOpen)( vlc_object_t *p_this ) p_cdda->b_cdtext_prefer = config_GetInt( p_access, MODULE_STRING "-cdtext-prefer" ); - p_cdda->b_header = VLC_FALSE; - p_cdda->p_cdio = p_cdio; - p_cdda->i_tracks = 0; - p_cdda->i_titles = 0; - p_cdda->i_track = i_track; - p_cdda->i_debug = config_GetInt(p_this, MODULE_STRING "-debug"); + p_cdda->psz_source = strdup(psz_source); + p_cdda->b_header = VLC_FALSE; + p_cdda->p_cdio = p_cdio; + p_cdda->i_tracks = 0; + p_cdda->i_titles = 0; + p_cdda->i_track = i_track; + p_cdda->i_debug = config_GetInt(p_this, MODULE_STRING "-debug"); p_cdda->i_blocks_per_read - = config_GetInt(p_this, MODULE_STRING "-blocks-per-read"); + = config_GetInt(p_this, MODULE_STRING "-blocks-per-read"); p_cdda->p_input = vlc_object_find( p_access, VLC_OBJECT_INPUT, FIND_PARENT ); @@ -418,7 +422,7 @@ int E_(CDDAOpen)( vlc_object_t *p_this ) i_rc = CDDAInit( p_access, p_cdda ); if ( VLC_SUCCESS != i_rc ) goto error; - CDDAFixupPlaylist( p_access, p_cdda, psz_source, b_single_track ); + CDDAFixupPlaylist( p_access, p_cdda, b_single_track ); /* Build a WAV header to put in front of the output data. This gets sent back in the Block (read) routine. @@ -486,7 +490,8 @@ void E_(CDDAClose)( vlc_object_t *p_this ) cddb_disc_destroy(p_cdda->cddb.disc); #endif - if (p_cdda->psz_mcn) free( p_cdda->psz_mcn ); + if (p_cdda->psz_mcn) free( p_cdda->psz_mcn ); + if (p_cdda->psz_source) free( p_cdda->psz_source ); free( p_cdda ); p_cdda_input = NULL; } @@ -557,8 +562,12 @@ static int CDDAControl( access_t *p_access, int i_query, va_list args ) case ACCESS_GET_TITLE_INFO: { - input_title_t ***ppp_title; - ppp_title = (input_title_t***)va_arg( args, input_title_t*** ); + unsigned int psz_mrl_max = strlen(CDDA_MRL_PREFIX) + + strlen(p_cdda->psz_source) + 1; + input_title_t ***ppp_title = + (input_title_t***)va_arg( args, input_title_t*** ); + char *psz_mrl = malloc( psz_mrl_max ); + pi_int = (int*)va_arg( args, int* ); *((int*)va_arg( args, int* )) = 1; /* Title offset */ @@ -566,6 +575,15 @@ static int CDDAControl( access_t *p_access, int i_query, va_list args ) "GET TITLE: i_tracks %d, i_tracks %d", p_cdda->i_tracks, p_cdda->i_tracks ); + if( psz_mrl == NULL ) { + msg_Warn( p_access, "out of memory" ); + } else { + snprintf(psz_mrl, psz_mrl_max, "%s%s", + CDDA_MRL_PREFIX, p_cdda->psz_source); + CDDAMetaInfo( p_access, -1, psz_mrl ); + free(psz_mrl); + } + /* Duplicate title info */ if( p_cdda->i_titles == 0 ) { @@ -583,7 +601,6 @@ static int CDDAControl( access_t *p_access, int i_query, va_list args ) (*ppp_title)[i] = vlc_input_title_Duplicate( p_cdda->p_title[i] ); } - } break; } @@ -603,7 +620,8 @@ static int CDDAControl( access_t *p_access, int i_query, va_list args ) p_access->info.i_pos = 0; /* Next sector to read */ - p_cdda->i_lsn = p_cdda->lsn[p_cdda->i_first_track+i]; + p_cdda->i_lsn = + cdio_get_track_lsn(p_cdda->p_cdio, p_cdda->i_first_track+i); } break; } @@ -635,7 +653,6 @@ static int CDDAControl( access_t *p_access, int i_query, va_list args ) *****************************************************************************/ static int CDDAInit( access_t *p_access, cdda_data_t *p_cdda ) { - track_t i; discmode_t discmode = CDIO_DISC_MODE_NO_INFO; p_cdda->i_tracks = cdio_get_num_tracks(p_cdda->p_cdio); @@ -656,18 +673,8 @@ static int CDDAInit( access_t *p_access, cdda_data_t *p_cdda ) return VLC_EGENERIC; } - /* Fill the lsn array with the track/sector matches. - Note cdio_get_track_lsn when given num_tracks + 1 will return - the leadout LSN. - */ - for( i = 0 ; i <= p_cdda->i_tracks ; i++ ) - { - track_t i_track = p_cdda->i_first_track + i; - (p_cdda->lsn)[ i_track ] = cdio_get_track_lsn(p_cdda->p_cdio, i_track); - } - /* Set reading start LSN. */ - p_cdda->i_lsn = p_cdda->lsn[p_cdda->i_track]; + p_cdda->i_lsn = cdio_get_track_lsn(p_cdda->p_cdio, p_cdda->i_track); return VLC_SUCCESS; } diff --git a/modules/access/cdda/cdda.h b/modules/access/cdda/cdda.h index 9001607e84..f2e7befc9f 100644 --- a/modules/access/cdda/cdda.h +++ b/modules/access/cdda/cdda.h @@ -31,6 +31,8 @@ #include #endif +#define CDDA_MRL_PREFIX "cddax://" + /* Frequency of sample in bits per second. */ #define CDDA_FREQUENCY_SAMPLE 44100 @@ -69,10 +71,6 @@ typedef struct cdda_data_s /* Current position */ track_t i_track; /* Current track */ lsn_t i_lsn; /* Current Logical Sector Number */ - lsn_t lsn[CDIO_CD_MAX_TRACKS]; /* Track LSNs. Origin is NOT - 0 origin but origin of track - number (usually 1). - */ int i_blocks_per_read; /* # blocks to get in a read */ int i_debug; /* Debugging mask */ @@ -80,6 +78,7 @@ typedef struct cdda_data_s /* Information about CD */ vlc_meta_t *p_meta; char * psz_mcn; /* Media Catalog Number */ + char * psz_source; /* CD drive or CD image filename */ input_title_t *p_title[CDIO_CD_MAX_TRACKS]; /* This *is* 0 origin, not track number origin */ diff --git a/modules/access/cdda/info.c b/modules/access/cdda/info.c index 05949b6077..1efbc550bc 100644 --- a/modules/access/cdda/info.c +++ b/modules/access/cdda/info.c @@ -38,8 +38,6 @@ # include #endif -#define CDDA_MRL_PREFIX "cddax://" - #ifdef HAVE_LIBCDDB #define free_and_dup(var, val) \ @@ -47,7 +45,9 @@ if (val) var=strdup(val); -static void GetCDDBInfo( access_t *p_access, cdda_data_t *p_cdda ) +/* Saves CDDB information about CD-DA via libcddb. */ +static void +GetCDDBInfo( access_t *p_access, cdda_data_t *p_cdda ) { int i, i_matches; cddb_conn_t *conn = cddb_new(); @@ -209,6 +209,43 @@ cddb_end: ; add_cdtext_info_str("Disc", TITLE, 0, FIELD) +/* + Saves Meta Information about the CD-DA. + + Saves information that CDDAMetaInfo uses. Should be called before + CDDAMetaInfo is called. + */ +void +CDDAMetaInfoInit( access_t *p_access, int i_track ) +{ + cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys; + + if ( ! p_cdda ) return; + + p_cdda->psz_mcn = cdio_get_mcn(p_cdda->p_cdio); + p_cdda->p_meta = vlc_meta_New(); + +#ifdef HAVE_LIBCDDB + if ( p_cdda->b_cddb_enabled ) + { + GetCDDBInfo(p_access, p_cdda); + } + +#endif /*HAVE_LIBCDDB*/ + +#define TITLE_MAX 30 + { + unsigned int i; + p_cdda->p_cdtext[0] = cdio_get_cdtext(p_cdda->p_cdio, 0); + + for( i = 0 ; i < p_cdda->i_tracks ; i++ ) + { + p_cdda->p_cdtext[i_track] = + cdio_get_cdtext(p_cdda->p_cdio, i_track); + } + } +} + /* Gets and saves Meta Information about the CD-DA. @@ -219,7 +256,8 @@ cddb_end: ; media info" or in playlist info. The intialization of CD-Text or CDDB is done here though. */ -void CDDAMetaInfo( access_t *p_access, int i_track, /*const*/ char *psz_mrl ) +void +CDDAMetaInfo( access_t *p_access, int i_track, /*const*/ char *psz_mrl ) { cdda_data_t *p_cdda = (cdda_data_t *) p_access->p_sys; char *psz_meta_title = psz_mrl; @@ -227,43 +265,35 @@ void CDDAMetaInfo( access_t *p_access, int i_track, /*const*/ char *psz_mrl ) if ( ! p_cdda ) return; - p_cdda->psz_mcn = cdio_get_mcn(p_cdda->p_cdio); - p_cdda->p_meta = vlc_meta_New(); - #ifdef HAVE_LIBCDDB - if ( p_cdda->b_cddb_enabled ) + if ( p_cdda->b_cddb_enabled && p_cdda->cddb.disc ) { - GetCDDBInfo(p_access, p_cdda); - if ( p_cdda->cddb.disc ) - { - if( i_track == -1 ) - { - psz_meta_title = p_cdda->cddb.disc->title; - psz_meta_artist = p_cdda->cddb.disc->artist; - - input_Control( p_cdda->p_input, INPUT_SET_NAME, - p_cdda->cddb.disc->artist ); - } - else - { - cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, - i_track-1); - if (t != NULL ) - { - if( t->title != NULL ) - { - add_meta_val( VLC_META_TITLE, t->title ); - } - if( t->artist != NULL ) - { - add_meta_val( VLC_META_ARTIST, t->artist ); - } - } - } - add_cddb_meta(genre, VLC_META_GENRE); - add_cddb_meta_fmt(year, "%d", VLC_META_DATE ); + if( i_track == -1 ) + { + psz_meta_title = p_cdda->cddb.disc->title; + psz_meta_artist = p_cdda->cddb.disc->artist; + + input_Control( p_cdda->p_input, INPUT_SET_NAME, + p_cdda->cddb.disc->artist ); } - + else + { + cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, + i_track-1); + if (t != NULL ) + { + if( t->title != NULL ) + { + add_meta_val( VLC_META_TITLE, t->title ); + } + if( t->artist != NULL ) + { + add_meta_val( VLC_META_ARTIST, t->artist ); + } + } + } + add_cddb_meta(genre, VLC_META_GENRE); + add_cddb_meta_fmt(year, "%d", VLC_META_DATE ); } #endif /*HAVE_LIBCDDB*/ @@ -273,9 +303,10 @@ void CDDAMetaInfo( access_t *p_access, int i_track, /*const*/ char *psz_mrl ) track_t i = p_cdda->i_tracks; const int i_first_track = p_cdda->i_first_track; char psz_buffer[MSTRTIME_MAX_SIZE]; - mtime_t i_duration = - (p_cdda->lsn[i_first_track+i] - p_cdda->lsn[i_first_track]) - / CDIO_CD_FRAMES_PER_SEC; + unsigned int i_track_frames = + cdio_get_track_lba(p_cdda->p_cdio, CDIO_CDROM_LEADOUT_TRACK); + + mtime_t i_duration = i_track_frames / CDIO_CD_FRAMES_PER_SEC; dbg_print( INPUT_DBG_META, "Duration %ld, tracks %d", (long int) i_duration, p_cdda->i_tracks ); @@ -301,7 +332,6 @@ void CDDAMetaInfo( access_t *p_access, int i_track, /*const*/ char *psz_mrl ) } #endif /*HAVE_LIBCDDB*/ - p_cdda->p_cdtext[0] = cdio_get_cdtext(p_cdda->p_cdio, 0); if (p_cdda->p_cdtext[0]) { char *psz_field; @@ -330,18 +360,17 @@ void CDDAMetaInfo( access_t *p_access, int i_track, /*const*/ char *psz_mrl ) { char psz_track[TITLE_MAX]; const track_t i_track = i_first_track + i; - mtime_t i_duration = (p_cdda->lsn[i_track+1] - - p_cdda->lsn[i_track]) - / CDIO_CD_FRAMES_PER_SEC; + unsigned int i_track_frames = + cdio_get_track_lsn(p_cdda->p_cdio, i_track+1) - + cdio_get_track_lsn(p_cdda->p_cdio, i_track); + + mtime_t i_duration = i_track_frames / CDIO_CD_FRAMES_PER_SEC; snprintf(psz_track, TITLE_MAX, "%s %02d", _("Track"), i_track); input_Control( p_cdda->p_input, INPUT_ADD_INFO, psz_track, _("Duration"), "%s", secstotimestr( psz_buffer, i_duration ) ); - p_cdda->p_cdtext[i_track] = - cdio_get_cdtext(p_cdda->p_cdio, i_track); - if (p_cdda->p_cdtext[i_track]) { add_cdtext_info_str( psz_track, "Arranger (CD-Text)", @@ -573,11 +602,13 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda, if (p_cdda->b_cddb_enabled) { char psz_buffer[MSTRTIME_MAX_SIZE]; - mtime_t i_duration = (p_cdda->lsn[i_track+1] - - p_cdda->lsn[i_track]) - / CDIO_CD_FRAMES_PER_SEC; - add_format_str_info(secstotimestr( psz_buffer, - i_duration ) ); + unsigned int i_track_frames = + cdio_get_track_lsn(p_cdda->p_cdio, i_track+1) - + cdio_get_track_lsn(p_cdda->p_cdio, i_track); + mtime_t i_duration = + i_track_frames / CDIO_CD_FRAMES_PER_SEC; + add_format_str_info( secstotimestr( psz_buffer, + i_duration ) ); } else goto not_special; break; #else @@ -665,11 +696,13 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda, playlist_item_t * CDDACreatePlaylistItem( const access_t *p_access, cdda_data_t *p_cdda, playlist_t *p_playlist, playlist_item_t *p_item, - track_t i_track, char *psz_mrl, int psz_mrl_max, - const char *psz_source ) + track_t i_track, char *psz_mrl, int psz_mrl_max ) { - mtime_t i_duration = (p_cdda->lsn[i_track+1] - p_cdda->lsn[i_track]) - * (1000000 / CDIO_CD_FRAMES_PER_SEC) ; + unsigned int i_track_frames = + cdio_get_track_lsn(p_cdda->p_cdio, i_track+1) - + cdio_get_track_lsn(p_cdda->p_cdio, i_track); + mtime_t i_mduration = + i_track_frames * (CLOCK_FREQ / CDIO_CD_FRAMES_PER_SEC) ; char *psz_title; char *config_varname = MODULE_STRING "-title-format"; @@ -689,18 +722,18 @@ CDDACreatePlaylistItem( const access_t *p_access, cdda_data_t *p_cdda, snprintf(psz_mrl, psz_mrl_max, "%s%s@T%u", - CDDA_MRL_PREFIX, psz_source, i_track); + CDDA_MRL_PREFIX, p_cdda->psz_source, i_track); psz_title = CDDAFormatStr( p_access, p_cdda, config_GetPsz( p_access, config_varname ), psz_mrl, i_track); dbg_print( INPUT_DBG_META, "mrl: %s, title: %s, duration, %ld", - psz_mrl, psz_title, (long int) i_duration / 1000000 ); + psz_mrl, psz_title, (long int) i_mduration / 1000000 ); p_child = playlist_ItemNew( p_playlist, psz_mrl, psz_title ); p_child->input.b_fixed_name = VLC_TRUE; - p_child->input.i_duration = i_duration; + p_child->input.i_duration = i_mduration; if( !p_child ) return NULL; @@ -713,12 +746,12 @@ CDDACreatePlaylistItem( const access_t *p_access, cdda_data_t *p_cdda, } int CDDAAddMetaToItem( access_t *p_access, cdda_data_t *p_cdda, - playlist_item_t *p_item, const char *psz_source, - int i_track, vlc_bool_t b_single ) + playlist_item_t *p_item, int i_track, + vlc_bool_t b_single ) { vlc_mutex_lock( &p_item->input.lock ); - add_playlist_track_info_str("Source", psz_source); + add_playlist_track_info_str("Source", p_cdda->psz_source); playlist_ItemAddInfo( p_item, _("Track"), _("Track Number"), "%d", i_track ); @@ -806,14 +839,15 @@ int CDDAAddMetaToItem( access_t *p_access, cdda_data_t *p_cdda, } int -CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda, - const char *psz_source, vlc_bool_t b_single_track ) +CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda, + vlc_bool_t b_single_track ) { int i; playlist_t * p_playlist; char * psz_mrl = NULL; - unsigned int psz_mrl_max = strlen(CDDA_MRL_PREFIX) + strlen(psz_source) + - strlen("@T") + strlen("100") + 1; + unsigned int psz_mrl_max = strlen(CDDA_MRL_PREFIX) + + strlen(p_cdda->psz_source) + + + strlen("@T") + strlen("100") + 1; const track_t i_first_track = p_cdda->i_first_track; playlist_item_t *p_item; vlc_bool_t b_play = VLC_FALSE; @@ -848,12 +882,15 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda, if( b_single_track ) { snprintf(psz_mrl, psz_mrl_max, "%s%s@T%u", CDDA_MRL_PREFIX, - psz_source, p_cdda->i_track); + p_cdda->psz_source, p_cdda->i_track); + CDDAMetaInfoInit( p_access, p_cdda->i_track ); CDDAMetaInfo( p_access, p_cdda->i_track, psz_mrl ); } else { - snprintf(psz_mrl, psz_mrl_max, "%s%s", CDDA_MRL_PREFIX, psz_source); + snprintf(psz_mrl, psz_mrl_max, "%s%s", CDDA_MRL_PREFIX, + p_cdda->psz_source); + CDDAMetaInfoInit( p_access, -1 ); CDDAMetaInfo( p_access, -1, psz_mrl ); } @@ -875,29 +912,28 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda, more mature. */ track_t i_track = p_cdda->i_track; - + unsigned int i_track_frames = + cdio_get_track_lsn(p_cdda->p_cdio, i_track+1) - + cdio_get_track_lsn(p_cdda->p_cdio, i_track); + input_title_t *t = p_cdda->p_title[0] = //i_track-i_first_track] = vlc_input_title_New(); asprintf( &t->psz_name, _("Track %i"), i_track ); - t->i_size = p_access->info.i_size = - ( p_cdda->lsn[i_track+1] - p_cdda->lsn[i_track] ) * - (int64_t) CDIO_CD_FRAMESIZE_RAW; + t->i_size = p_access->info.i_size = + i_track_frames * (int64_t) CDIO_CD_FRAMESIZE_RAW; t->i_length = I64C(1000000) * t->i_size / CDDA_FREQUENCY_SAMPLE / 4; - CDDAAddMetaToItem( p_access, p_cdda, p_item, psz_source, i_track, - VLC_FALSE ); + CDDAAddMetaToItem( p_access, p_cdda, p_item, i_track, VLC_FALSE ); p_cdda->i_titles = 1; p_access->info.i_size = - (p_cdda->lsn[p_cdda->i_track-1] - - p_cdda->lsn[i_first_track]) * (int64_t) CDIO_CD_FRAMESIZE_RAW; + i_track_frames * (int64_t) CDIO_CD_FRAMESIZE_RAW; p_access->info.i_update |= INPUT_UPDATE_TITLE|INPUT_UPDATE_SIZE; - p_item->input.i_duration = - (p_cdda->lsn[p_cdda->i_track] - - p_cdda->lsn[i_first_track+1]) / CDIO_CD_FRAMES_PER_SEC; + p_item->input.i_duration = i_track_frames + * (CLOCK_FREQ / CDIO_CD_FRAMES_PER_SEC); } else { @@ -906,29 +942,30 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda, { playlist_item_t *p_child; const track_t i_track = i_first_track + i; + unsigned int i_track_frames = + cdio_get_track_lsn(p_cdda->p_cdio, i_track+1) - + cdio_get_track_lsn(p_cdda->p_cdio, i_track); + input_title_t *t = p_cdda->p_title[i] = vlc_input_title_New(); asprintf( &t->psz_name, _("Track %i"), i_track ); - t->i_size = ( p_cdda->lsn[i_track+1] - p_cdda->lsn[i_track] ) * - (int64_t) CDIO_CD_FRAMESIZE_RAW; + t->i_size = i_track_frames * (int64_t) CDIO_CD_FRAMESIZE_RAW; t->i_length = I64C(1000000) * t->i_size / CDDA_FREQUENCY_SAMPLE / 4; p_child = CDDACreatePlaylistItem( p_access, p_cdda, p_playlist, p_item, i_track, psz_mrl, - psz_mrl_max, psz_source ); - CDDAAddMetaToItem( p_access, p_cdda, p_child, psz_source, - i_track, VLC_TRUE ); + psz_mrl_max ) ; + CDDAAddMetaToItem( p_access, p_cdda, p_child, i_track, VLC_TRUE ); } p_cdda->i_titles = p_cdda->i_tracks; /* should be +1 */ p_access->info.i_size = - (p_cdda->lsn[p_cdda->i_tracks] - - p_cdda->lsn[0]) * (int64_t) CDIO_CD_FRAMESIZE_RAW; + cdio_get_track_lba(p_cdda->p_cdio, CDIO_CDROM_LEADOUT_TRACK) + * (int64_t) CDIO_CD_FRAMESIZE_RAW; p_access->info.i_update |= INPUT_UPDATE_TITLE|INPUT_UPDATE_SIZE; p_item->input.i_duration = - (p_cdda->lsn[p_cdda->i_tracks] - - p_cdda->lsn[0]) / CDIO_CD_FRAMES_PER_SEC; + p_access->info.i_size * (CLOCK_FREQ / CDIO_CD_FRAMES_PER_SEC) ; } if( b_play ) diff --git a/modules/access/cdda/info.h b/modules/access/cdda/info.h index a323c258ad..5d0bbe6a9b 100644 --- a/modules/access/cdda/info.h +++ b/modules/access/cdda/info.h @@ -25,7 +25,6 @@ Fills out playlist information. */ int CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda, - const char *psz_source, vlc_bool_t b_single_track ); /* @@ -35,6 +34,14 @@ int CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda, */ void CDDAMetaInfo( access_t *p_access, int, /*const*/ char *psz_mrl ); +/* + Saves Meta Information about the CD-DA. + + Saves information that CDDAMetaInfo uses. Should be called before + CDDAMetaInfo is called. + */ +void CDDAMetaInfoInit( access_t *p_access, int i_track ); + /* Creates a playlist item filling the meta information about that playlist @@ -43,5 +50,4 @@ void CDDAMetaInfo( access_t *p_access, int, /*const*/ char *psz_mrl ); playlist_item_t * CDDACreatePlaylistItem( const access_t *p_access, cdda_data_t *p_cdda, playlist_t *p_playlist, playlist_item_t *p_item, - track_t i_track, char *psz_mrl, int psz_mrl_max, - const char *psz_source ); + track_t i_track, char *psz_mrl, int psz_mrl_max ); -- 2.39.2