[vlc-devel] commit: psz_intf_switch was read-only: remove dead code ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Aug 28 18:25:55 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Thu Aug 28 19:25:57 2008 +0300| [9ba4d0ff87e47d06ed1242bf3d4a36ac468aa3fc] | committer: Rémi Denis-Courmont 

psz_intf_switch was read-only: remove dead code

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ba4d0ff87e47d06ed1242bf3d4a36ac468aa3fc
---

 include/vlc_interface.h                          |    3 --
 modules/gui/qt4/components/interface_widgets.cpp |   12 +------
 modules/gui/wxwidgets/video.cpp                  |   12 +------
 src/interface/interface.c                        |   37 +++------------------
 4 files changed, 10 insertions(+), 54 deletions(-)

diff --git a/include/vlc_interface.h b/include/vlc_interface.h
index 0fb7b6c..ef35a07 100644
--- a/include/vlc_interface.h
+++ b/include/vlc_interface.h
@@ -74,9 +74,6 @@ struct intf_thread_t
     vlc_mutex_t  change_lock;
     bool   b_menu_change;
     bool   b_menu;
-
-    /* Provides the ability to switch an interface on the fly */
-    char *psz_switch_intf;
 };
 
 /** \brief Arguments passed to a dialogs provider
diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index d5d9b68..56987d1 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -114,16 +114,8 @@ VideoWidget::~VideoWidget()
 
     if( p_vout )
     {
-        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 );
-        }
+        if( vout_Control( p_vout, VOUT_CLOSE ) != VLC_SUCCESS )
+            vout_Control( p_vout, VOUT_REPARENT );
         vlc_object_release( p_vout );
     }
 }
diff --git a/modules/gui/wxwidgets/video.cpp b/modules/gui/wxwidgets/video.cpp
index 3474908..2eace2d 100644
--- a/modules/gui/wxwidgets/video.cpp
+++ b/modules/gui/wxwidgets/video.cpp
@@ -155,16 +155,8 @@ VideoWindow::~VideoWindow()
     vlc_mutex_lock( &lock );
     if( p_vout )
     {
-        if( !p_intf->psz_switch_intf )
-        {
-            if( vout_Control( p_vout, VOUT_CLOSE ) != VLC_SUCCESS )
-                vout_Control( p_vout, VOUT_REPARENT, 0 );
-        }
-        else
-        {
-            if( vout_Control( p_vout, VOUT_REPARENT, 0 ) != VLC_SUCCESS )
-                vout_Control( p_vout, VOUT_CLOSE );
-        }
+        if( vout_Control( p_vout, VOUT_CLOSE ) != VLC_SUCCESS )
+            vout_Control( p_vout, VOUT_REPARENT, 0 );
     }
 
     p_intf->pf_request_window = NULL;
diff --git a/src/interface/interface.c b/src/interface/interface.c
index e268c7c..3183c98 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -224,41 +224,16 @@ static void* RunInterface( vlc_object_t *p_this )
 
     var_AddCallback( p_intf, "intf-add", AddIntfCallback, NULL );
 
-    do
+    /* Give control to the interface */
+    if( p_intf->pf_run )
+        p_intf->pf_run( p_intf );
+    else
     {
-        /* Give control to the interface */
-        if( p_intf->pf_run )
-            p_intf->pf_run( p_intf );
-        else
-        {
-            vlc_object_lock( p_intf );
-            while( vlc_object_alive( p_intf ) )
-                vlc_object_wait( p_intf );
-            vlc_object_unlock( p_intf );
-        }
-
-        if( !p_intf->psz_switch_intf )
-        {
-            break;
-        }
-
-        /* Make sure the old interface is completely uninitialized */
-        module_Unneed( p_intf, p_intf->p_module );
-
-        /* Provide ability to switch the main interface on the fly */
-        psz_intf = p_intf->psz_switch_intf;
-        p_intf->psz_switch_intf = NULL;
-
         vlc_object_lock( p_intf );
-        p_intf->b_die = false; /* FIXME */
-        p_intf->b_dead = false;
-
+        while( vlc_object_alive( p_intf ) )
+            vlc_object_wait( p_intf );
         vlc_object_unlock( p_intf );
-
-        p_intf->psz_intf = psz_intf;
-        p_intf->p_module = module_Need( p_intf, "interface", psz_intf, 0 );
     }
-    while( p_intf->p_module );
 
     vlc_restorecancel (canc);
     return NULL;




More information about the vlc-devel mailing list