* Preamble
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
#include <vlc_input.h>
#include <vlc_access.h>
+#include <vlc_meta.h>
#include <vlc_codecs.h> /* For WAVEHEADER */
#include "vcd/cdrom.h"
psz_name = var_CreateGetString( p_this, "cd-audio" );
if( !psz_name || !*psz_name )
{
- if( psz_name ) free( psz_name );
+ free( psz_name );
return VLC_EGENERIC;
}
}
case ACCESS_GET_META:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
+ case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
}
p_item_in_category = playlist_ItemToNode( p_playlist, p_parent, VLC_FALSE );
- vlc_mutex_lock( &p_playlist->object_lock );
playlist_ItemSetName( p_parent, "Audio CD" );
- vlc_mutex_unlock( &p_playlist->object_lock );
var_SetInteger( p_playlist, "item-change", p_parent->p_input->i_id );
#ifdef HAVE_LIBCDDB
if( cddb_disc_get_title( p_sys->p_disc ) )
{
const char *psz_name = cddb_disc_get_title( p_sys->p_disc );
- vlc_mutex_lock( &p_playlist->object_lock );
playlist_ItemSetName( p_parent, psz_name );
- vlc_mutex_unlock( &p_playlist->object_lock );
var_SetInteger( p_playlist, "item-change",
p_parent->p_input->i_id );
}
/* If we have CDDB info, change the name */
if( p_sys->p_disc )
{
- const char *psz_result;
cddb_track_t *t = cddb_disc_get_track( p_sys->p_disc, i );
if( t!= NULL )
{
if( cddb_track_get_title( t ) != NULL )
{
- input_ItemAddInfo( p_input_item, _(VLC_META_INFO_CAT),
- _(VLC_META_TITLE),
- "%s", cddb_track_get_title( t ) );
- if( p_input_item->psz_name )
- free( p_input_item->psz_name );
+ free( p_input_item->psz_name );
p_input_item->psz_name = strdup( cddb_track_get_title( t ) );
+ input_item_SetTitle( p_input_item, cddb_track_get_title( t ) );
}
- psz_result = cddb_track_get_artist( t );
- if( psz_result )
+ if( cddb_track_get_artist( t ) != NULL )
{
- input_ItemAddInfo( p_input_item, _(VLC_META_INFO_CAT),
- _(VLC_META_ARTIST), "%s", psz_result );
+ input_item_SetArtist( p_input_item, cddb_track_get_artist( t ) );
}
}
}
#endif
- playlist_BothAddInput( p_playlist, p_input_item, p_item_in_category,
+ int i_ret = playlist_BothAddInput( p_playlist, p_input_item,
+ p_item_in_category,
PLAYLIST_APPEND, PLAYLIST_END, NULL, NULL,
VLC_FALSE );
+ vlc_gc_decref( p_input_item );
free( psz_uri ); free( psz_opt ); free( psz_name );
free( psz_first ); free( psz_last );
+ if( i_ret != VLC_SUCCESS )
+ return VLC_EGENERIC;
}
return VLC_SUCCESS;
}