Commit 0c4c7f06 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: fixed interface crash on quit

 fixes #5779
parent 52eae1b9
......@@ -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