[vlc-commits] macosx: fixed interface crash on quit
Felix Paul Kühne
git at videolan.org
Fri Jan 6 20:42:14 CET 2012
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Jan 6 20:42:05 2012 +0100| [0c4c7f06de78d4ace0f33103dc66b9f81cd964fc] | committer: Felix Paul Kühne
macosx: fixed interface crash on quit
fixes #5779
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0c4c7f06de78d4ace0f33103dc66b9f81cd964fc
---
modules/gui/macosx/CoreInteraction.m | 18 +++++++++++++++---
modules/gui/macosx/intf.m | 2 +-
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/modules/gui/macosx/CoreInteraction.m b/modules/gui/macosx/CoreInteraction.m
index a9a9eb1..a4d7c69 100644
--- a/modules/gui/macosx/CoreInteraction.m
+++ b/modules/gui/macosx/CoreInteraction.m
@@ -135,10 +135,22 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
- (int)playbackRate
{
- playlist_t * p_playlist = pl_Get( VLCIntf );
+ float f_rate;
+
+ input_thread_t * p_input;
+ p_input = pl_CurrentInput( VLCIntf );
+ if (p_input)
+ {
+ f_rate = var_GetFloat( p_input, "rate" );
+ vlc_object_release( p_input );
+ }
+ else
+ {
+ playlist_t * p_playlist = pl_Get( VLCIntf );
+ NSLog( @"playlist rate = %f", f_rate );
+ }
- float rate = var_GetFloat( p_playlist, "rate" );
- double value = 17 * log( rate ) / log( 2. );
+ double value = 17 * log( f_rate ) / log( 2. );
int returnValue = (int) ( ( value > 0 ) ? value + .5 : value - .5 );
if( returnValue < -34 )
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 1ec3e07..389260b 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -252,7 +252,7 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
[[VLCMain sharedInstance] playbackStatusUpdated];
break;
case INPUT_EVENT_RATE:
- [[VLCMainMenu sharedInstance] performSelectorOnMainThread:@selector(updatePlaybackRate) withObject: nil waitUntilDone:NO];
+ [[[VLCMain sharedInstance] mainMenu] performSelectorOnMainThread:@selector(updatePlaybackRate) withObject: nil waitUntilDone:NO];
break;
case INPUT_EVENT_POSITION:
[[VLCMain sharedInstance] updatePlaybackPosition];
More information about the vlc-commits
mailing list