Commit 3338391d authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Jean-Baptiste Kempf

macosx: fixed interface crash on quit

 fixes #5779
(cherry picked from commit 0c4c7f06de78d4ace0f33103dc66b9f81cd964fc)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent eac12c57
......@@ -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 )
......
......@@ -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];
......
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