Commit 7963ddf0 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx/framework: Remove the newly removed exception parameter.

Most of them where already NULL, saying how meaningless it was.
parent 12a36253
......@@ -110,9 +110,6 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
- (void)setVideoCropGeometry:(char *)value;
- (char *)videoCropGeometry;
- (void)setVideoTeleText:(NSUInteger)value;
- (NSUInteger)videoTeleText;
/**
* Take a snapshot of the current video.
*
......
......@@ -231,10 +231,10 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
* 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);
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);
libvlc_event_detach(p_em, libvlc_MediaSubItemAdded, HandleMediaSubItemAdded, self, NULL);
libvlc_event_detach(p_em, libvlc_MediaMetaChanged, HandleMediaMetaChanged, self);
libvlc_event_detach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self);
libvlc_event_detach(p_em, libvlc_MediaStateChanged, HandleMediaStateChanged, self);
libvlc_event_detach(p_em, libvlc_MediaSubItemAdded, HandleMediaSubItemAdded, self);
}
[super release];
}
......
......@@ -90,17 +90,19 @@ static void HandleMediaDiscovererEnded( const libvlc_event_t * event, void * use
if (self = [super init])
{
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_exception_init(&ex);
localizedName = nil;
discoveredMedia = nil;
mdis = libvlc_media_discoverer_new_from_name( [VLCLibrary sharedInstance],
mdis = libvlc_media_discoverer_new_from_name([VLCLibrary sharedInstance],
[aServiceName UTF8String],
&ex );
catch_exception( &ex );
&ex);
catch_exception(&ex);
libvlc_event_manager_t * p_em = libvlc_media_discoverer_event_manager(mdis);
libvlc_event_attach(p_em, libvlc_MediaDiscovererStarted, HandleMediaDiscovererStarted, self, NULL);
libvlc_event_attach(p_em, libvlc_MediaDiscovererEnded, HandleMediaDiscovererEnded, self, NULL);
libvlc_event_attach(p_em, libvlc_MediaDiscovererStarted, HandleMediaDiscovererStarted, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaDiscovererEnded, HandleMediaDiscovererEnded, self, &ex);
catch_exception( &ex );
running = libvlc_media_discoverer_is_running(mdis);
}
return self;
......@@ -115,9 +117,9 @@ static void HandleMediaDiscovererEnded( const libvlc_event_t * event, void * use
/* 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_list_event_manager(mdis, NULL);
libvlc_event_detach(p_em, libvlc_MediaDiscovererStarted, HandleMediaDiscovererStarted, self, NULL);
libvlc_event_detach(p_em, libvlc_MediaDiscovererEnded, HandleMediaDiscovererEnded, self, NULL);
libvlc_event_manager_t * p_em = libvlc_media_list_event_manager(mdis);
libvlc_event_detach(p_em, libvlc_MediaDiscovererStarted, HandleMediaDiscovererStarted, self);
libvlc_event_detach(p_em, libvlc_MediaDiscovererEnded, HandleMediaDiscovererEnded, self);
}
[super release];
}
......
......@@ -99,9 +99,9 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
/* 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_list_event_manager(p_mlist, NULL);
libvlc_event_detach(p_em, libvlc_MediaListItemDeleted, HandleMediaListItemDeleted, self, NULL);
libvlc_event_detach(p_em, libvlc_MediaListItemAdded, HandleMediaListItemAdded, self, NULL);
libvlc_event_manager_t * p_em = libvlc_media_list_event_manager(p_mlist);
libvlc_event_detach(p_em, libvlc_MediaListItemDeleted, HandleMediaListItemDeleted, self);
libvlc_event_detach(p_em, libvlc_MediaListItemAdded, HandleMediaListItemAdded, self);
}
[super release];
}
......@@ -177,11 +177,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
- (NSInteger)indexOfMedia:(VLCMedia *)media
{
libvlc_exception_t p_e;
libvlc_exception_init( &p_e );
NSInteger result = libvlc_media_list_index_of_item( p_mlist, [media libVLCMediaDescriptor], &p_e );
catch_exception( &p_e );
NSInteger result = libvlc_media_list_index_of_item(p_mlist, [media libVLCMediaDescriptor]);
return result;
}
......@@ -262,9 +258,9 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
p_mlist = p_new_mlist;
libvlc_media_list_retain( p_mlist );
libvlc_media_list_lock( p_mlist );
cachedMedia = [[NSMutableArray alloc] initWithCapacity:libvlc_media_list_count( p_mlist, NULL )];
cachedMedia = [[NSMutableArray alloc] initWithCapacity:libvlc_media_list_count(p_mlist)];
NSUInteger i, count = libvlc_media_list_count( p_mlist, NULL );
NSUInteger i, count = libvlc_media_list_count(p_mlist);
for( i = 0; i < count; i++ )
{
libvlc_media_t * p_md = libvlc_media_list_item_at_index( p_mlist, i, NULL );
......@@ -290,7 +286,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
libvlc_exception_t p_e;
libvlc_exception_init( &p_e );
libvlc_event_manager_t * p_em = libvlc_media_list_event_manager( p_mlist, &p_e );
libvlc_event_manager_t * p_em = libvlc_media_list_event_manager(p_mlist);
libvlc_event_attach( p_em, libvlc_MediaListItemAdded, HandleMediaListItemAdded, self, &p_e );
libvlc_event_attach( p_em, libvlc_MediaListItemDeleted, HandleMediaListItemDeleted, self, &p_e );
......
......@@ -135,8 +135,8 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
* 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_list_view_event_manager(p_mlv);
libvlc_event_detach(p_em, libvlc_MediaListViewItemDeleted, HandleMediaListViewItemDeleted, self, NULL);
libvlc_event_detach(p_em, libvlc_MediaListViewItemAdded, HandleMediaListViewItemAdded, self, NULL);
libvlc_event_detach(p_em, libvlc_MediaListViewItemDeleted, HandleMediaListViewItemDeleted, self);
libvlc_event_detach(p_em, libvlc_MediaListViewItemAdded, HandleMediaListViewItemAdded, self);
}
[super release];
}
......@@ -276,14 +276,14 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
- (void)initInternalMediaListView
{
libvlc_exception_t e;
libvlc_exception_init( &e );
libvlc_exception_init(&e);
libvlc_event_manager_t * p_em = libvlc_media_list_event_manager( p_mlv, &e );
libvlc_event_manager_t * p_em = libvlc_media_list_event_manager(p_mlv);
/* Add internal callback */
libvlc_event_attach( p_em, libvlc_MediaListViewItemAdded, HandleMediaListViewItemAdded, self, &e );
libvlc_event_attach( p_em, libvlc_MediaListViewItemDeleted, HandleMediaListViewItemDeleted, self, &e );
catch_exception( &e );
libvlc_event_attach(p_em, libvlc_MediaListViewItemAdded, HandleMediaListViewItemAdded, self, &e);
libvlc_event_attach(p_em, libvlc_MediaListViewItemDeleted, HandleMediaListViewItemDeleted, self, &e);
catch_exception(&e);
}
- (void)mediaListViewItemAdded:(NSArray *)arrayOfArgs
......
......@@ -41,8 +41,7 @@
libvlc_exception_init(&ex);
instance = libvlc_media_list_player_new([VLCLibrary sharedInstance], &ex);
catch_exception(&ex);
libvlc_media_list_player_set_media_player(instance, [_mediaPlayer libVLCMediaPlayer], &ex);
catch_exception(&ex);
libvlc_media_list_player_set_media_player(instance, [_mediaPlayer libVLCMediaPlayer]);
}
return self;
}
......@@ -67,10 +66,7 @@
[_mediaList release];
_mediaList = [mediaList retain];
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_media_list_player_set_media_list(instance, [mediaList libVLCMediaList], &ex);
catch_exception(&ex);
libvlc_media_list_player_set_media_list(instance, [mediaList libVLCMediaList]);
[self willChangeValueForKey:@"rootMedia"];
[_rootMedia release];
_rootMedia = nil;
......@@ -125,30 +121,28 @@
- (void)stop
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_media_list_player_stop(instance, &ex);
catch_exception(&ex);
libvlc_media_list_player_stop(instance);
}
- (void)setRepeatMode:(VLCRepeatMode)repeatMode
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_playback_mode_t mode;
switch (repeatMode) {
case VLCRepeatAllItems:
libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_default, &ex);
mode = libvlc_playback_mode_loop;
break;
case VLCDoNotRepeat:
libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_default, &ex);
mode = libvlc_playback_mode_default;
break;
case VLCRepeatCurrentItem:
libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_repeat, &ex);
mode = libvlc_playback_mode_repeat;
break;
default:
NSAssert(0, @"Should not be reached");
break;
}
catch_exception(&ex);
libvlc_media_list_player_set_playback_mode(instance, mode);
_repeatMode = repeatMode;
}
......
......@@ -207,7 +207,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
- (void)dealloc
{
NSAssert(libvlc_media_player_get_state(instance, NULL) == libvlc_Stopped, @"You released the media player before ensuring that it is stopped");
NSAssert(libvlc_media_player_get_state(instance) == libvlc_Stopped, @"You released the media player before ensuring that it is stopped");
// Always get rid of the delegate first so we can stop sending messages to it
// TODO: Should we tell the delegate that we're shutting down?
......@@ -216,7 +216,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
// Clear our drawable as we are going to release it, we don't
// want the core to use it from this point. This won't happen as
// the media player must be stopped.
libvlc_media_player_set_nsobject(instance, nil, NULL);
libvlc_media_player_set_nsobject(instance, nil);
libvlc_media_player_release(instance);
......@@ -252,10 +252,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
- (void)setDrawable:(id)aDrawable
{
// Make sure that this instance has been associated with the drawing canvas.
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_media_player_set_nsobject(instance, aDrawable, &ex);
catch_exception( &ex );
libvlc_media_player_set_nsobject(instance, aDrawable);
}
- (id)drawable
......@@ -316,7 +313,11 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
- (NSArray *)videoSubTitles
{
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_track_description_t *currentTrack = libvlc_video_get_spu_description( instance, &ex );
catch_exception( &ex );
NSMutableArray *tempArray = [NSMutableArray array];
while (currentTrack) {
[tempArray addObject:[NSString stringWithUTF8String:currentTrack->psz_name]];
......@@ -366,23 +367,6 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
return result;
}
- (void)setVideoTeleText:(NSUInteger)value
{
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_video_set_teletext( instance, value, &ex );
catch_exception( &ex );
}
- (NSUInteger)videoTeleText
{
libvlc_exception_t ex;
libvlc_exception_init( &ex );
NSInteger result = libvlc_video_get_teletext( instance, &ex );
catch_exception( &ex );
return result;
}
- (void)saveVideoSnapshotAt: (NSString *)path withWidth:(NSUInteger)width andHeight:(NSUInteger)height
{
libvlc_exception_t ex;
......@@ -660,10 +644,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
[media release];
media = [value retain];
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_media_player_set_media( instance, [media libVLCMediaDescriptor], &ex );
catch_exception( &ex );
libvlc_media_player_set_media(instance, [media libVLCMediaDescriptor]);
}
}
......@@ -695,8 +676,8 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
// Pause the stream
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_media_player_pause( (libvlc_media_player_t *)instance, &ex );
libvlc_exception_init(&ex);
libvlc_media_player_pause(instance, &ex);
// fail gracefully
// in most cases, it's just EOF so let's stop
......@@ -708,10 +689,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
- (void)stop
{
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_media_player_stop((libvlc_media_player_t *)instance, &ex);
catch_exception( &ex );
libvlc_media_player_stop(instance);
}
- (void)fastForward
......@@ -904,28 +882,28 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
libvlc_exception_init( &ex );
// Attach event observers into the media instance
libvlc_event_manager_t * p_em = libvlc_media_player_event_manager( instance, &ex );
libvlc_event_attach( p_em, libvlc_MediaPlayerPlaying, HandleMediaInstanceStateChanged, self, &ex );
libvlc_event_attach( p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self, &ex );
libvlc_event_attach( p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self, &ex );
libvlc_event_attach( p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self, &ex );
libvlc_event_manager_t * p_em = libvlc_media_player_event_manager(instance);
libvlc_event_attach(p_em, libvlc_MediaPlayerPlaying, HandleMediaInstanceStateChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self, &ex);
/* FIXME: We may want to turn that off when none is interested by that */
libvlc_event_attach( p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self, &ex );
libvlc_event_attach( p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self, &ex );
libvlc_event_attach( p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self, &ex );
catch_exception( &ex );
libvlc_event_attach(p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self, &ex);
catch_exception(&ex);
}
- (void)unregisterObservers
{
libvlc_event_manager_t * p_em = libvlc_media_player_event_manager( instance, NULL );
libvlc_event_detach( p_em, libvlc_MediaPlayerPlaying, HandleMediaInstanceStateChanged, self, NULL );
libvlc_event_detach( p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self, NULL );
libvlc_event_detach( p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self, NULL );
libvlc_event_detach( p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self, NULL );
libvlc_event_detach( p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self, NULL );
libvlc_event_detach( p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self, NULL );
libvlc_event_attach( p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self, NULL );
libvlc_event_manager_t * p_em = libvlc_media_player_event_manager(instance);
libvlc_event_detach(p_em, libvlc_MediaPlayerPlaying, HandleMediaInstanceStateChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self);
libvlc_event_detach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self);
}
- (void)mediaPlayerTimeChanged:(NSNumber *)newTime
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment