]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/vout.m
macosx: Define playlist_IsStopped(), and make sure it returns the very next state...
[vlc] / modules / gui / macosx / vout.m
index 4fde1d1078f382f32f094909ba53117092f1a1b7..a59b6f68b07821fb3d02b1e8e432f426f1d346ef 100644 (file)
@@ -984,10 +984,15 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 - (void)closeVout
 {
     playlist_t * p_playlist = pl_Yield( VLCIntf );
+    PL_LOCK;
+    bool stopped = playlist_IsStopped( p_playlist );
+    PL_UNLOCK;
 
-    if(!playlist_IsPlaying( p_playlist ))
+    if(stopped)
         [o_window performSelectorOnMainThread: @selector(orderOut:) withObject: self waitUntilDone: YES];
+    else
+        msg_Dbg( VLCIntf, "we are not closing the window, playlist is playing" );
+
     vlc_object_release( p_playlist );
 
     [super closeVout];