+
+ /* Retreive CD-TEXT informations but prefer CDDB */
+ if( i+1 < i_cd_text && pp_cd_text[i+1] )
+ {
+ const vlc_meta_t *t = pp_cd_text[i+1];
+
+ ON_EMPTY( psz_track_title, vlc_meta_Get( t, vlc_meta_Title ) );
+ ON_EMPTY( psz_track_artist, vlc_meta_Get( t, vlc_meta_Artist ) );
+ ON_EMPTY( psz_track_genre, vlc_meta_Get( t, vlc_meta_Genre ) );
+ ON_EMPTY( psz_track_description, vlc_meta_Get( t, vlc_meta_Description ) );
+ }
+
+ /* */
+ ON_EMPTY( psz_track_artist, psz_artist );
+ ON_EMPTY( psz_track_genre, psz_genre );
+ ON_EMPTY( psz_track_description, psz_description );
+
+ /* */
+ if( NONEMPTY( psz_track_title ) )
+ {
+ input_item_SetName( p_input_item, psz_track_title );
+ input_item_SetTitle( p_input_item, psz_track_title );
+ }
+
+ if( NONEMPTY( psz_track_artist ) )
+ input_item_SetArtist( p_input_item, psz_track_artist );
+
+ if( NONEMPTY( psz_track_genre ) )
+ input_item_SetGenre( p_input_item, psz_track_genre );
+
+ if( NONEMPTY( psz_track_description ) )
+ input_item_SetDescription( p_input_item, psz_track_description );
+
+ if( NONEMPTY( psz_album ) )
+ input_item_SetAlbum( p_input_item, psz_album );
+
+ if( NONEMPTY( psz_year ) )
+ input_item_SetDate( p_input_item, psz_year );
+
+ char psz_num[3+1];
+ snprintf( psz_num, sizeof(psz_num), "%d", 1+i );
+ input_item_SetTrackNum( p_input_item, psz_num );
+
+ input_item_node_AppendItem( p_root, p_input_item );