Commit ab915f99 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx: Define playlist_IsStopped(), and make sure it returns the very next...

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.)
parent 58159c00
......@@ -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 )
......
......@@ -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];
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment