From: Pierre d'Herbemont Date: Sun, 6 Jul 2008 22:06:21 +0000 (+0200) Subject: macosx: Define playlist_IsStopped(), and make sure it returns the very next state... X-Git-Tag: 0.9.0-test2~149 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=ab915f9988bd01e3b9d5ec25a19f9006d2040f8d;p=vlc macosx: Define playlist_IsStopped(), and make sure it returns the very next state. Fix #1674. (Hitting the button stop on Mac OS X interface doesn't close the vout window.) --- diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h index 2490a136e2..39e464c7b2 100644 --- a/include/vlc_playlist.h +++ b/include/vlc_playlist.h @@ -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 ) diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m index 4fde1d1078..a59b6f68b0 100644 --- a/modules/gui/macosx/vout.m +++ b/modules/gui/macosx/vout.m @@ -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]; diff --git a/modules/gui/macosx/voutgl.m b/modules/gui/macosx/voutgl.m index cfcdaf0393..86256177c9 100644 --- a/modules/gui/macosx/voutgl.m +++ b/modules/gui/macosx/voutgl.m @@ -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);