Commit 788a3c84 authored by Gildas Bazin's avatar Gildas Bazin

* src/video_output/vout_intf.c: only embed the video if the main interface...

* src/video_output/vout_intf.c: only embed the video if the main interface supports it (don't check other interfaces).
* modules/gui/wxwindows/video.cpp, modules/video_output/x11/xcommon.c: in embedded mode, close the vout window if vlc is exiting.
parent 9717a696
...@@ -127,8 +127,12 @@ VideoWindow::~VideoWindow() ...@@ -127,8 +127,12 @@ VideoWindow::~VideoWindow()
vlc_mutex_lock( &lock ); vlc_mutex_lock( &lock );
if( p_vout ) if( p_vout )
{ {
if( vout_Control( p_vout, VOUT_REPARENT ) != VLC_SUCCESS ) if( !p_intf->psz_switch_intf )
vout_Control( p_vout, VOUT_CLOSE ); if( vout_Control( p_vout, VOUT_CLOSE ) != VLC_SUCCESS )
vout_Control( p_vout, VOUT_REPARENT );
else
if( vout_Control( p_vout, VOUT_REPARENT ) != VLC_SUCCESS )
vout_Control( p_vout, VOUT_CLOSE );
} }
p_intf->pf_request_window = NULL; p_intf->pf_request_window = NULL;
......
...@@ -2123,6 +2123,13 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -2123,6 +2123,13 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
vlc_mutex_unlock( &p_vout->p_sys->lock ); vlc_mutex_unlock( &p_vout->p_sys->lock );
return VLC_SUCCESS; return VLC_SUCCESS;
case VOUT_CLOSE:
vlc_mutex_lock( &p_vout->p_sys->lock );
XUnmapWindow( p_vout->p_sys->p_display,
p_vout->p_sys->p_win->base_window );
vlc_mutex_unlock( &p_vout->p_sys->lock );
/* Fall through */
case VOUT_REPARENT: case VOUT_REPARENT:
vlc_mutex_lock( &p_vout->p_sys->lock ); vlc_mutex_lock( &p_vout->p_sys->lock );
XReparentWindow( p_vout->p_sys->p_display, XReparentWindow( p_vout->p_sys->p_display,
......
...@@ -75,14 +75,14 @@ void *vout_RequestWindow( vout_thread_t *p_vout, ...@@ -75,14 +75,14 @@ void *vout_RequestWindow( vout_thread_t *p_vout,
var_Get( p_vout->p_vlc, "drawable", &val ); var_Get( p_vout->p_vlc, "drawable", &val );
if( val.i_int ) return (void *)val.i_int; if( val.i_int ) return (void *)val.i_int;
/* Find the first interface which supports embedding */ /* Find if the main interface supports embedding */
p_list = vlc_list_find( p_vout, VLC_OBJECT_INTF, FIND_ANYWHERE ); p_list = vlc_list_find( p_vout, VLC_OBJECT_INTF, FIND_ANYWHERE );
if( !p_list ) return NULL; if( !p_list ) return NULL;
for( i = 0; i < p_list->i_count; i++ ) for( i = 0; i < p_list->i_count; i++ )
{ {
p_intf = (intf_thread_t *)p_list->p_values[i].p_object; p_intf = (intf_thread_t *)p_list->p_values[i].p_object;
if( p_intf->pf_request_window ) break; if( p_intf->b_block && p_intf->pf_request_window ) break;
p_intf = NULL; p_intf = NULL;
} }
......
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