Commit 8fe16309 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: fix crash when trying to use the video menu

parent 8018c67d
...@@ -423,12 +423,17 @@ ...@@ -423,12 +423,17 @@
- (IBAction)showPosition: (id)sender - (IBAction)showPosition: (id)sender
{ {
vout_thread_t *p_vout = input_GetVout( pl_CurrentInput( VLCIntf )); input_thread_t * p_input = pl_CurrentInput( VLCIntf );
if( p_input != NULL )
{
vout_thread_t *p_vout = input_GetVout( p_input );
if( p_vout != NULL ) if( p_vout != NULL )
{ {
var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_POSITION ); var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_POSITION );
vlc_object_release( (vlc_object_t *)p_vout ); vlc_object_release( (vlc_object_t *)p_vout );
} }
vlc_object_release( p_input );
}
} }
- (IBAction)toogleFullscreen:(id)sender { - (IBAction)toogleFullscreen:(id)sender {
...@@ -448,8 +453,11 @@ ...@@ -448,8 +453,11 @@
- (IBAction)windowAction:(id)sender - (IBAction)windowAction:(id)sender
{ {
NSString *o_title = [sender title]; NSString *o_title = [sender title];
input_thread_t * p_input = pl_CurrentInput( VLCIntf );
vout_thread_t *p_vout = input_GetVout( pl_CurrentInput( VLCIntf )); if( p_input != NULL )
{
vout_thread_t *p_vout = input_GetVout( p_input );
if( p_vout != NULL ) if( p_vout != NULL )
{ {
id o_vout_view = [self voutView]; id o_vout_view = [self voutView];
...@@ -495,7 +503,8 @@ ...@@ -495,7 +503,8 @@
pl_Release( VLCIntf ); pl_Release( VLCIntf );
} }
vlc_object_release( p_input );
}
} }
- (IBAction)telxTransparent:(id)sender - (IBAction)telxTransparent:(id)sender
...@@ -612,7 +621,10 @@ ...@@ -612,7 +621,10 @@
if( key ) if( key )
{ {
vout_thread_t *p_vout = input_GetVout( pl_CurrentInput( VLCIntf )); input_thread_t * p_input = pl_CurrentInput( VLCIntf );
if( p_input != NULL )
{
vout_thread_t *p_vout = input_GetVout( p_input );
if( p_vout != NULL ) if( p_vout != NULL )
{ {
...@@ -633,6 +645,8 @@ ...@@ -633,6 +645,8 @@
} }
vlc_object_release( (vlc_object_t *)p_vout ); vlc_object_release( (vlc_object_t *)p_vout );
} }
vlc_object_release( p_input );
}
} }
return eventHandled; return eventHandled;
} }
...@@ -986,9 +1000,8 @@ ...@@ -986,9 +1000,8 @@
else if( [[o_mi title] isEqualToString: _NS("Previous")] || else if( [[o_mi title] isEqualToString: _NS("Previous")] ||
[[o_mi title] isEqualToString: _NS("Next")] ) [[o_mi title] isEqualToString: _NS("Next")] )
{ {
/** \todo fix i_size use */
PL_LOCK; PL_LOCK;
bEnabled = p_playlist->items.i_size > 1; bEnabled = playlist_CurrentSize( p_playlist ) > 1;
PL_UNLOCK; PL_UNLOCK;
} }
else if( [[o_mi title] isEqualToString: _NS("Random")] ) else if( [[o_mi title] isEqualToString: _NS("Random")] )
...@@ -1041,7 +1054,9 @@ ...@@ -1041,7 +1054,9 @@
NSEnumerator *o_enumerator = [o_windows objectEnumerator]; NSEnumerator *o_enumerator = [o_windows objectEnumerator];
bEnabled = FALSE; bEnabled = FALSE;
vout_thread_t *p_vout = input_GetVout( pl_CurrentInput( VLCIntf )); if( p_input != NULL )
{
vout_thread_t *p_vout = input_GetVout( p_input );
if( p_vout != NULL ) if( p_vout != NULL )
{ {
if( [[o_mi title] isEqualToString: _NS("Float on Top")] ) if( [[o_mi title] isEqualToString: _NS("Float on Top")] )
...@@ -1063,6 +1078,8 @@ ...@@ -1063,6 +1078,8 @@
vlc_object_release( (vlc_object_t *)p_vout ); vlc_object_release( (vlc_object_t *)p_vout );
} }
vlc_object_release( p_input );
}
if( [[o_mi title] isEqualToString: _NS("Fullscreen")] ) if( [[o_mi title] isEqualToString: _NS("Fullscreen")] )
{ {
var_Get( p_playlist, "fullscreen", &val ); var_Get( p_playlist, "fullscreen", &val );
......
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