/* We must make sure we won't receive new event after an upcoming dealloc
* We also may receive a -retain in some event callback that may occcur
* Before libvlc_event_detach. So this can't happen in dealloc */
- libvlc_event_manager_t * p_em = libvlc_media_event_manager(p_md, NULL);
+ libvlc_event_manager_t * p_em = libvlc_media_event_manager(p_md);
libvlc_event_detach(p_em, libvlc_MediaMetaChanged, HandleMediaMetaChanged, self, NULL);
// libvlc_event_detach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self, NULL);
libvlc_event_detach(p_em, libvlc_MediaStateChanged, HandleMediaStateChanged, self, NULL);
- (BOOL)isPreparsed
{
- return libvlc_media_is_preparsed( p_md, NULL );
+ return libvlc_media_is_preparsed( p_md );
}
@synthesize url;
{
if (self = [super init])
{
- libvlc_exception_t ex;
- libvlc_exception_init( &ex );
-
libvlc_media_retain( md );
p_md = md;
artFetched = NO;
- char * p_url = libvlc_media_get_mrl( p_md, &ex );
- catch_exception( &ex );
+ char * p_url = libvlc_media_get_mrl( p_md );
url = [[NSURL URLWithString:[NSString stringWithUTF8String:p_url]] retain];
if( !url ) /* Attempt to interpret as a file path then */
url = [[NSURL fileURLWithPath:[NSString stringWithUTF8String:p_url]] retain];
free( p_url );
- libvlc_media_set_user_data( p_md, (void*)self, &ex );
- catch_exception( &ex );
+ libvlc_media_set_user_data( p_md, (void*)self );
- libvlc_event_manager_t * p_em = libvlc_media_event_manager( p_md, &ex );
+ libvlc_event_manager_t * p_em = libvlc_media_event_manager( p_md );
libvlc_event_attach(p_em, libvlc_MediaMetaChanged, HandleMediaMetaChanged, self, &ex);
// libvlc_event_attach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaStateChanged, HandleMediaStateChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaSubItemAdded, HandleMediaSubItemAdded, self, &ex);
- catch_exception( &ex );
- libvlc_media_list_t * p_mlist = libvlc_media_subitems( p_md, NULL );
+ libvlc_media_list_t * p_mlist = libvlc_media_subitems( p_md );
if (!p_mlist)
subitems = nil;
libvlc_media_list_release( p_mlist );
}
- state = LibVLCStateToMediaState(libvlc_media_get_state( p_md, NULL ));
+ state = LibVLCStateToMediaState(libvlc_media_get_state( p_md ));
/* Force VLCMetaInformationTitle, that will trigger preparsing
* And all the other meta will be added through the libvlc event system */
- (void)fetchMetaInformationFromLibVLCWithType:(NSString *)metaType
{
- char * psz_value = libvlc_media_get_meta( p_md, [VLCMedia stringToMetaType:metaType], NULL);
+ char * psz_value = libvlc_media_get_meta( p_md, [VLCMedia stringToMetaType:metaType] );
NSString * newValue = psz_value ? [NSString stringWithUTF8String: psz_value] : nil;
NSString * oldValue = [metaDictionary valueForKey:metaType];
free(psz_value);
if( subitems )
return; /* Nothing to do */
- libvlc_media_list_t * p_mlist = libvlc_media_subitems( p_md, NULL );
+ libvlc_media_list_t * p_mlist = libvlc_media_subitems( p_md );
NSAssert( p_mlist, @"The mlist shouldn't be nil, we are receiving a subItemAdded");