+ /* CD-Text */
+ vlc_meta_t **pp_cd_text;
+ int i_cd_text;
+
+ if( ioctl_GetCdText( VLC_OBJECT(p_access), p_sys->vcddev, &pp_cd_text, &i_cd_text ) )
+ {
+ msg_Dbg( p_access, "CD-TEXT information missing" );
+ i_cd_text = 0;
+ pp_cd_text = NULL;
+ }
+
+ /* Retrieve CD-TEXT information but prefer CDDB */
+ if( i_cd_text > 0 && pp_cd_text[0] )
+ {
+ const vlc_meta_t *p_disc = pp_cd_text[0];
+ ON_EMPTY( psz_album, vlc_meta_Get( p_disc, vlc_meta_Album ) );
+ ON_EMPTY( psz_genre, vlc_meta_Get( p_disc, vlc_meta_Genre ) );
+ ON_EMPTY( psz_artist, vlc_meta_Get( p_disc, vlc_meta_Artist ) );
+ ON_EMPTY( psz_description, vlc_meta_Get( p_disc, vlc_meta_Description ) );
+ }
+
+ if( NONEMPTY( psz_album ) )
+ {
+ input_item_SetName( p_current, psz_album );
+ input_item_SetAlbum( p_current, psz_album );
+ }
+
+ if( NONEMPTY( psz_genre ) )
+ input_item_SetGenre( p_current, psz_genre );
+
+ if( NONEMPTY( psz_artist ) )
+ input_item_SetArtist( p_current, psz_artist );
+
+ if( NONEMPTY( psz_year ) )
+ input_item_SetDate( p_current, psz_year );
+
+ if( NONEMPTY( psz_description ) )
+ input_item_SetDescription( p_current, psz_description );
+
+ const mtime_t i_duration = (int64_t)( p_sys->p_sectors[i_titles] - p_sys->p_sectors[0] ) *
+ CDDA_DATA_SIZE * 1000000 / 44100 / 2 / 2;
+ input_item_SetDuration( p_current, i_duration );
+
+ input_item_node_t *p_root = input_item_node_Create( p_current );
+