]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/vout_window.cpp
skins2/src/ft2_font.*: s/initalize/initialize/
[vlc] / modules / gui / skins2 / src / vout_window.cpp
index d394bb3821a2edbd35da981b405d02583ea0e340..dec3a312556af24763d677ad43882c44542567d3 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * vout_window.cpp
  *****************************************************************************
- * Copyright (C) 2003 VideoLAN
+ * Copyright (C) 2003 the VideoLAN team
  * $Id$
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #include "vout_window.hpp"
+#include "vlcproc.hpp"
 #include "os_factory.hpp"
 #include "os_graphics.hpp"
 #include "os_window.hpp"
@@ -42,7 +43,15 @@ VoutWindow::~VoutWindow()
     {
         delete m_pImage;
     }
-    // XXX we should stop the vout before destroying the window!
+
+    // Get the VlcProc
+    VlcProc *pVlcProc = getIntf()->p_sys->p_vlcProc;
+
+    // Reparent the video output
+    if( pVlcProc && pVlcProc->isVoutUsed() )
+    {
+        pVlcProc->dropVout();
+    }
 }
 
 
@@ -69,7 +78,14 @@ void VoutWindow::refresh( int left, int top, int width, int height )
 {
     if( m_pImage )
     {
-        m_pImage->copyToWindow( *getOSWindow(), left, top, width, height, left,
-                                top );
+        // Get the VlcProc
+        VlcProc *pVlcProc = getIntf()->p_sys->p_vlcProc;
+
+        // Refresh only when there is no video!
+        if( pVlcProc && !pVlcProc->isVoutUsed() )
+        {
+            m_pImage->copyToWindow( *getOSWindow(), left, top,
+                                    width, height, left, top );
+        }
     }
 }