[vlc-commits] macosx: fixed interface crash on quit
Felix Paul Kühne
git at videolan.org
Sat Jan 7 01:29:54 CET 2012
vlc/vlc-1.2 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Jan 6 20:42:05 2012 +0100| [3338391df0767cf471f9e298f37fa7714148158a] | committer: Jean-Baptiste Kempf
macosx: fixed interface crash on quit
fixes #5779
(cherry picked from commit 0c4c7f06de78d4ace0f33103dc66b9f81cd964fc)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=3338391df0767cf471f9e298f37fa7714148158a
---
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