[vlc-commits] qt: fix video moved to the art container when a first vout fails

Thomas Guillem git at videolan.org
Mon Mar 5 09:28:51 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Mar  1 17:24:33 2018 +0100| [b3b4e36b6bd296dd58d6dd2e3f9af5f9c007588d] | committer: Thomas Guillem

qt: fix video moved to the art container when a first vout fails

If a vout probe fails, releaseVideoSlot() will be called with an input with a
valid Video. This will cause the showTab() method to stack the videoWidget into
the artContainer.

(cherry picked from commit 8cc46013dac455067c83b9488673ec95574ca33a)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 modules/gui/qt/main_interface.cpp | 12 ++++++------
 modules/gui/qt/main_interface.hpp |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index 35e46ece20..f5496a2782 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -626,10 +626,10 @@ void MainInterface::debug()
 }
 
 inline void MainInterface::showVideo() { showTab( videoWidget ); }
-inline void MainInterface::restoreStackOldWidget()
-            { showTab( stackCentralOldWidget ); }
+inline void MainInterface::restoreStackOldWidget( bool video_closing )
+            { showTab( stackCentralOldWidget, video_closing ); }
 
-inline void MainInterface::showTab( QWidget *widget )
+inline void MainInterface::showTab( QWidget *widget, bool video_closing )
 {
     if ( !widget ) widget = bgWidget; /* trying to restore a null oldwidget */
 #ifdef DEBUG_INTF
@@ -652,7 +652,7 @@ inline void MainInterface::showTab( QWidget *widget )
     stackWidgetsSizes[stackCentralOldWidget] = stackCentralW->size();
 
     /* If we are playing video, embedded */
-    if( videoWidget && THEMIM->getIM()->hasVideo() )
+    if( !video_closing && videoWidget && THEMIM->getIM()->hasVideo() )
     {
         /* Video -> Playlist */
         if( videoWidget == stackCentralOldWidget && widget == playlistWidget )
@@ -695,7 +695,7 @@ inline void MainInterface::showTab( QWidget *widget )
 #endif
 
     /* This part is done later, to account for the new pl size */
-    if( videoWidget && THEMIM->getIM()->hasVideo() &&
+    if( !video_closing && videoWidget && THEMIM->getIM()->hasVideo() &&
         videoWidget == stackCentralOldWidget && widget == playlistWidget )
     {
         playlistWidget->artContainer->addWidget( videoWidget );
@@ -789,7 +789,7 @@ void MainInterface::releaseVideoSlot( void )
     hideResumePanel();
 
     if( stackCentralW->currentWidget() == videoWidget )
-        restoreStackOldWidget();
+        restoreStackOldWidget( true );
     else if( playlistWidget &&
              playlistWidget->artContainer->currentWidget() == videoWidget )
     {
diff --git a/modules/gui/qt/main_interface.hpp b/modules/gui/qt/main_interface.hpp
index 7cad9d71cd..5f60d2f307 100644
--- a/modules/gui/qt/main_interface.hpp
+++ b/modules/gui/qt/main_interface.hpp
@@ -126,9 +126,9 @@ protected:
     void handleSystray();
 
     /* Central StackWidget Management */
-    void showTab( QWidget *);
+    void showTab( QWidget *, bool video_closing = false );
     void showVideo();
-    void restoreStackOldWidget();
+    void restoreStackOldWidget( bool video_closing = false );
 
     /* */
     void displayNormalView();



More information about the vlc-commits mailing list