]> git.sesse.net Git - vlc/commitdiff
macosx: don't send key events to inexistent p_vout.
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 1 Aug 2008 14:36:56 +0000 (16:36 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Sun, 3 Aug 2008 00:07:03 +0000 (02:07 +0200)
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.

modules/gui/macosx/vout.m

index dc85fd97181a853abed5e36c2f4539c150cef877..0f55c636d63d1b4ad7fb293ab63452834f00e5c0 100644 (file)
@@ -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
     {