#endif
#include <assert.h>
+#include <errno.h>
#include <vlc/libvlc.h>
#include <vlc/libvlc_media.h>
[libvlc_meta_Publisher] = vlc_meta_Publisher,
[libvlc_meta_EncodedBy] = vlc_meta_EncodedBy,
[libvlc_meta_ArtworkURL] = vlc_meta_ArtworkURL,
- [libvlc_meta_TrackID] = vlc_meta_TrackID
+ [libvlc_meta_TrackID] = vlc_meta_TrackID,
+ [libvlc_meta_TrackTotal] = vlc_meta_TrackTotal,
+ [libvlc_meta_Director] = vlc_meta_Director,
+ [libvlc_meta_Season] = vlc_meta_Season,
+ [libvlc_meta_Episode] = vlc_meta_Episode,
+ [libvlc_meta_ShowName] = vlc_meta_ShowName,
+ [libvlc_meta_Actors] = vlc_meta_Actors
};
static const libvlc_meta_t vlc_to_libvlc_meta[] =
[vlc_meta_Publisher] = libvlc_meta_Publisher,
[vlc_meta_EncodedBy] = libvlc_meta_EncodedBy,
[vlc_meta_ArtworkURL] = libvlc_meta_ArtworkURL,
- [vlc_meta_TrackID] = libvlc_meta_TrackID
+ [vlc_meta_TrackID] = libvlc_meta_TrackID,
+ [vlc_meta_TrackTotal] = libvlc_meta_TrackTotal,
+ [vlc_meta_Director] = libvlc_meta_Director,
+ [vlc_meta_Season] = libvlc_meta_Season,
+ [vlc_meta_Episode] = libvlc_meta_Episode,
+ [vlc_meta_ShowName] = libvlc_meta_ShowName,
+ [vlc_meta_Actors] = libvlc_meta_Actors
};
/**************************************************************************
p_event->u.input_item_subitem_added.p_new_child );
/* Add this to our media list */
- if( !p_md->p_subitems )
+ if( p_md->p_subitems == NULL )
{
p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance );
+ if( unlikely(p_md->p_subitems == NULL) )
+ abort();
libvlc_media_list_set_media( p_md->p_subitems, p_md );
}
- if( p_md->p_subitems )
- {
- libvlc_media_list_add_media( p_md->p_subitems, p_md_child );
- }
+ libvlc_media_list_add_media( p_md->p_subitems, p_md_child );
/* Construct the event */
event.type = libvlc_MediaSubItemAdded;
static void input_item_subitemtree_added( const vlc_event_t * p_event,
void * user_data )
{
+ VLC_UNUSED( p_event );
libvlc_media_t * p_md = user_data;
libvlc_event_t event;
char *mrl = vlc_path2uri( path, NULL );
if( unlikely(mrl == NULL) )
{
- libvlc_printerr( "Not enough memory" );
+ libvlc_printerr( "%s", vlc_strerror_c(errno) );
return NULL;
}
static int media_parse(libvlc_media_t *media)
{
- /* TODO: fetcher and parser independent of playlist */
-#warning FIXME: remove pl_Get
- playlist_t *playlist = pl_Get(media->p_libvlc_instance->p_libvlc_int);
+ libvlc_int_t *libvlc = media->p_libvlc_instance->p_libvlc_int;
+ input_item_t *item = media->p_input_item;
/* TODO: Fetch art on need basis. But how not to break compatibility? */
- playlist_AskForArtEnqueue(playlist, media->p_input_item );
- return playlist_PreparseEnqueue(playlist, media->p_input_item);
+ libvlc_ArtRequest(libvlc, item, META_REQUEST_OPTION_NONE);
+ return libvlc_MetaRequest(libvlc, item, META_REQUEST_OPTION_NONE);
}
/**************************************************************************