Commit 116945aa authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

macosx: don't send key events to inexistent p_vout.

Fixes a crash when changing deinterlace filter during pause and then pressing a hotkey (like play-pause). In this case the old vout is destroyed, but the new vout has not received an image yet and has therefore not spawned the new window yet.

We want to keep the possibility of using ESC to leave fullscreen if required, So I don't think we should disable key events all together in this rare case.
parent cc76eb7b
......@@ -492,17 +492,16 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
[self toggleFullscreen];
}
}
else if ( key == ' ' )
else if ( p_vout )
{
vlc_value_t val;
val.i_int = config_GetInt( p_vout, "key-play-pause" );
var_Set( p_vout->p_libvlc, "key-pressed", val );
}
else
{
val.i_int |= CocoaKeyToVLC( key );
if( key == ' ')
val.i_int = config_GetInt( p_vout, "key-play-pause" );
else
val.i_int |= CocoaKeyToVLC( key );
var_Set( p_vout->p_libvlc, "key-pressed", val );
}
else NSLog( @"Could not send keyevent to VLC core" );
}
else
{
......
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