-#ifdef HAVE_LIBCDDB
- if (p_cdda->b_cddb_enabled) {
- cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc,
- i_track-p_cdda->i_first_track);
-
- add_playlist_track_info_str("Disc Album (CDDB)",
- p_cdda->cddb.disc->title);
- add_playlist_track_info_str("Disc Artist(s) (CDDB)",
- p_cdda->cddb.disc->artist);
- add_playlist_track_info_str("Disc Category (CDDB)",
- CDDB_CATEGORY[p_cdda->cddb.disc->category]);
- add_playlist_track_info_str("Disc Genre (CDDB)",
- p_cdda->cddb.disc->genre);
- if ( p_cdda->cddb.disc->discid ) {
- playlist_ItemAddInfo( p_item, _("Track"), _("Disc ID (CDDB)"),
- "%x", p_cdda->cddb.disc->discid );
+ snprintf(psz_mrl, psz_mrl_max, "%s%s@T%u",
+ CDDA_MRL_PREFIX, psz_source, i_track);
+
+ dbg_print( INPUT_DBG_META, "mrl: %s, title: %s, duration, %ld",
+ psz_mrl, psz_title, (long int) i_duration / 1000000 );
+
+ p_child = playlist_ItemNew( p_playlist, psz_mrl, psz_title );
+ p_child->input.b_fixed_name = VLC_TRUE;
+
+ if( !p_child ) return NULL;
+
+ playlist_NodeAddItem( p_playlist, p_child,
+ p_item->pp_parents[0]->i_view,
+ p_item, PLAYLIST_APPEND, PLAYLIST_END );
+ playlist_CopyParents( p_item, p_child );
+
+ return p_child;
+}
+
+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 )
+{
+ vlc_mutex_lock( &p_item->input.lock );
+
+ add_playlist_track_info_str("Source", psz_source);
+ playlist_ItemAddInfo( p_item, _("Track"), _("Track Number"),
+ "%d", i_track );
+
+ if (p_cdda->p_cdtext[0])
+ {
+ const cdtext_t *p = p_cdda->p_cdtext[0];
+ add_playlist_track_info_str("Disc Arranger (CD-Text)",
+ p->field[CDTEXT_ARRANGER]);
+ add_playlist_track_info_str("Disc Composer (CD-Text)",
+ p->field[CDTEXT_COMPOSER]);
+ add_playlist_track_info_str("Disc ID (CD-Text)",
+ p->field[CDTEXT_DISCID]);
+ add_playlist_track_info_str("Disc Genre (CD-Text)",
+ p->field[CDTEXT_GENRE]);
+ add_playlist_track_info_str("Disc Message (CD-Text)",
+ p->field[CDTEXT_MESSAGE]);
+ add_playlist_track_info_str("Disc Performer (CD-Text)",
+ p->field[CDTEXT_PERFORMER]);
+ add_playlist_track_info_str("Disc Songwriter (CD-Text)",
+ p->field[CDTEXT_SONGWRITER]);
+ add_playlist_track_info_str("Disc Title (CD-Text)",
+ p->field[CDTEXT_TITLE]);