- }
- return strdup(temp_str);
-}
-
-static void
-CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda,
- playlist_t *p_playlist, unsigned int i_track,
- char *psz_mrl, int psz_mrl_max,
- const char *psz_source, int playlist_operation,
- int i_pos)
-{
- mtime_t i_duration =
- (p_cdda->p_sectors[i_track] - p_cdda->p_sectors[i_track-1])
- * (1000000 / CDIO_CD_FRAMES_PER_SEC) ;
- char *p_author;
- char *p_title;
- char *config_varname = MODULE_STRING "-title-format";
- playlist_item_t *p_item;
-
-#ifdef HAVE_LIBCDDB
- if (p_cdda->i_cddb_enabled) {
- config_varname = MODULE_STRING "-cddb-title-format";
- }
-#endif /*HAVE_LIBCDDB*/
-
- snprintf(psz_mrl, psz_mrl_max, "%s%s@T%u",
- CDDA_MRL_PREFIX, psz_source, i_track);
-
- p_title = CDDAFormatStr(p_input, p_cdda,
- config_GetPsz( p_input, config_varname ),
- psz_mrl, i_track);
-
- dbg_print( INPUT_DBG_META, "mrl: %s, title: %s, duration, %ld, pos %d",
- psz_mrl, p_title, (long int) i_duration / 1000000 , i_pos );
- playlist_AddExt( p_playlist, psz_mrl, p_title, playlist_operation,
- i_pos, i_duration , NULL, 0);
-
- if( i_pos == PLAYLIST_END ) i_pos = p_playlist->i_size - 1;
-
- vlc_mutex_lock( &p_playlist->object_lock );
- p_item = playlist_ItemGetByPos( p_playlist, i_pos );
- vlc_mutex_unlock( &p_playlist->object_lock );
- if( !p_item )
- return;
-
- vlc_mutex_lock( &p_item->lock );
-
- p_author =
- CDDAFormatStr( p_input, p_cdda,
- config_GetPsz( p_input, MODULE_STRING "-author-format" ),
- psz_mrl, i_track );