[vlc-devel] commit: macosx: don't send key events to inexistent p_vout. ( Derk-Jan Hartman )

git version control git at videolan.org
Sun Aug 3 02:04:46 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Fri Aug  1 16:36:56 2008 +0200| [116945aa67e2d27c0756e673942cca2c0a854e8c] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=116945aa67e2d27c0756e673942cca2c0a854e8c
---

 modules/gui/macosx/vout.m |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m
index dc85fd9..0f55c63 100644
--- a/modules/gui/macosx/vout.m
+++ b/modules/gui/macosx/vout.m
@@ -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
     {




More information about the vlc-devel mailing list