]> git.sesse.net Git - vlc/commitdiff
macosx: Define playlist_IsStopped(), and make sure it returns the very next state...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 6 Jul 2008 22:06:21 +0000 (00:06 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 6 Jul 2008 22:06:21 +0000 (00:06 +0200)
include/vlc_playlist.h
modules/gui/macosx/vout.m
modules/gui/macosx/voutgl.m

index 2490a136e2d50442773e55bdfcd80d365d1c444f..39e464c7b2bb836e92868b2fa738c95874037511 100644 (file)
@@ -417,7 +417,11 @@ static inline int playlist_Import( playlist_t *p_playlist, const char *psz_file)
 
 
 /** Tell if the playlist is currently running */
-#define playlist_IsPlaying( pl ) ( pl->status.i_status == PLAYLIST_RUNNING )
+#define playlist_IsPlaying( pl ) ( pl->status.i_status == PLAYLIST_RUNNING && \
+            !(pl->request.b_request && pl->request.i_status == PLAYLIST_STOPPED) )
+
+#define playlist_IsStopped( pl ) ( pl->status.i_status == PLAYLIST_STOPPED || \
+            (pl->request.b_request && pl->request.i_status == PLAYLIST_STOPPED) )
 
 /** Tell if the playlist is empty */
 #define playlist_IsEmpty( pl ) ( pl->items.i_size == 0 )
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];
index cfcdaf0393f5e6a8bc42e074e67247cde3baee97..86256177c9500eeacd7ec99cadae8fb04100a966 100644 (file)
@@ -200,6 +200,9 @@ int OpenVideoGL  ( vlc_object_t * p_this )
 void CloseVideoGL ( vlc_object_t * p_this )
 {
     vout_thread_t * p_vout = (vout_thread_t *) p_this;
+
+    msg_Dbg( p_this, "Closing" );
+
     if( p_vout->p_sys->b_embedded )
     {
         aglDestroyContext(p_vout->p_sys->agl_ctx);