]> git.sesse.net Git - vlc/commitdiff
* src/video_output/vout_intf.c: only embed the video if the main interface supports...
authorGildas Bazin <gbazin@videolan.org>
Sat, 5 Jun 2004 17:49:22 +0000 (17:49 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sat, 5 Jun 2004 17:49:22 +0000 (17:49 +0000)
* modules/gui/wxwindows/video.cpp, modules/video_output/x11/xcommon.c: in embedded mode, close the vout window if vlc is exiting.

modules/gui/wxwindows/video.cpp
modules/video_output/x11/xcommon.c
src/video_output/vout_intf.c

index e8e6f0d99007c57031f2a41fd8d92dd5f9645c29..4cded777700a0b3c85468c2040a4a791569244b9 100644 (file)
@@ -127,8 +127,12 @@ VideoWindow::~VideoWindow()
     vlc_mutex_lock( &lock );
     if( p_vout )
     {
-        if( vout_Control( p_vout, VOUT_REPARENT ) != VLC_SUCCESS )
-            vout_Control( p_vout, VOUT_CLOSE );
+        if( !p_intf->psz_switch_intf )
+            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;
index 863f69bc26c9ac75fa0f17150f1c436ed820d187..0b7180d392a5a39e0a39f50b1879c35e333ce4c2 100644 (file)
@@ -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 );
             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:
             vlc_mutex_lock( &p_vout->p_sys->lock );
             XReparentWindow( p_vout->p_sys->p_display,
index 5dc92b956f4e0aecc1db2694406651ddc2b5d160..515dabf99c0a102212a80e5bf36a1a0475fdc863 100644 (file)
@@ -75,14 +75,14 @@ void *vout_RequestWindow( vout_thread_t *p_vout,
     var_Get( p_vout->p_vlc, "drawable", &val );
     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 );
     if( !p_list ) return NULL;
 
     for( i = 0; i < p_list->i_count; i++ )
     {
         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;
     }