[vlc-commits] qt: Don't try to modify constant values

Hugo Beauzée-Luyssen git at videolan.org
Thu Jan 26 11:03:12 CET 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Jan 25 16:33:16 2017 +0100| [1323cb0b2da1aa2400ed10ba0a81fb9c547fcf7f] | committer: Hugo Beauzée-Luyssen

qt: Don't try to modify constant values

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

 modules/gui/qt/components/interface_widgets.cpp |  9 +--------
 modules/gui/qt/components/interface_widgets.hpp |  2 +-
 modules/gui/qt/main_interface.cpp               | 14 +++++++-------
 modules/gui/qt/main_interface.hpp               |  7 +++----
 modules/gui/qt/qt.cpp                           |  5 +----
 5 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/modules/gui/qt/components/interface_widgets.cpp b/modules/gui/qt/components/interface_widgets.cpp
index c7f4cd1..0c17c20 100644
--- a/modules/gui/qt/components/interface_widgets.cpp
+++ b/modules/gui/qt/components/interface_widgets.cpp
@@ -100,8 +100,7 @@ void VideoWidget::sync( void )
 /**
  * Request the video to avoid the conflicts
  **/
-WId VideoWidget::request( struct vout_window_t *p_wnd, unsigned int *pi_width,
-                          unsigned int *pi_height, bool b_keep_size )
+WId VideoWidget::request( struct vout_window_t *p_wnd )
 {
     if( stable )
     {
@@ -110,12 +109,6 @@ WId VideoWidget::request( struct vout_window_t *p_wnd, unsigned int *pi_width,
     }
     assert( !p_window );
 
-    if( b_keep_size )
-    {
-        *pi_width  = size().width();
-        *pi_height = size().height();
-    }
-
     /* The owner of the video window needs a stable handle (WinId). Reparenting
      * in Qt4-X11 changes the WinId of the widget, so we need to create another
      * dummy widget that stays within the reparentable widget. */
diff --git a/modules/gui/qt/components/interface_widgets.hpp b/modules/gui/qt/components/interface_widgets.hpp
index 1f1dfda..5eeeda3 100644
--- a/modules/gui/qt/components/interface_widgets.hpp
+++ b/modules/gui/qt/components/interface_widgets.hpp
@@ -59,7 +59,7 @@ public:
     VideoWidget( intf_thread_t * );
     virtual ~VideoWidget();
 
-    WId request( struct vout_window_t *, unsigned int *, unsigned int *, bool );
+    WId request( struct vout_window_t * );
     void  release( void );
     void  sync( void );
 
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index fb12ba2..59a3345 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -187,8 +187,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
 
     /* VideoWidget connects for asynchronous calls */
     b_videoFullScreen = false;
-    connect( this, SIGNAL(askGetVideo(WId*,struct vout_window_t*,unsigned*,unsigned *, bool)),
-             this, SLOT(getVideoSlot(WId*,struct vout_window_t*,unsigned*,unsigned*, bool)),
+    connect( this, SIGNAL(askGetVideo(WId*, struct vout_window_t*, unsigned, unsigned, bool)),
+             this, SLOT(getVideoSlot(WId*, struct vout_window_t*, unsigned, unsigned, bool)),
              Qt::BlockingQueuedConnection );
     connect( this, SIGNAL(askReleaseVideo( void )),
              this, SLOT(releaseVideoSlot( void )),
@@ -683,7 +683,7 @@ void MainInterface::toggleFSC()
  * That's why we have all those emit statements...
  */
 WId MainInterface::getVideo( struct vout_window_t *p_wnd,
-                             unsigned int *pi_width, unsigned int *pi_height,
+                             unsigned int i_width, unsigned int i_height,
                              bool fullscreen )
 {
     if( !videoWidget )
@@ -692,12 +692,12 @@ WId MainInterface::getVideo( struct vout_window_t *p_wnd,
     /* This is a blocking call signal. Results are returned through pointers.
      * Beware of deadlocks! */
     WId id;
-    emit askGetVideo( &id, p_wnd, pi_width, pi_height, fullscreen );
+    emit askGetVideo( &id, p_wnd, i_width, i_height, fullscreen );
     return id;
 }
 
 void MainInterface::getVideoSlot( WId *p_id, struct vout_window_t *p_wnd,
-                                  unsigned *pi_width, unsigned *pi_height,
+                                  unsigned i_width, unsigned i_height,
                                   bool fullscreen )
 {
     /* Hidden or minimized, activate */
@@ -705,7 +705,7 @@ void MainInterface::getVideoSlot( WId *p_id, struct vout_window_t *p_wnd,
         toggleUpdateSystrayMenu();
 
     /* Request the videoWidget */
-    WId ret = videoWidget->request( p_wnd, pi_width, pi_height, !b_autoresize );
+    WId ret = videoWidget->request( p_wnd );
     *p_id = ret;
     if( ret ) /* The videoWidget is available */
     {
@@ -716,7 +716,7 @@ void MainInterface::getVideoSlot( WId *p_id, struct vout_window_t *p_wnd,
 
         /* Ask videoWidget to resize correctly, if we are in normal mode */
         if( b_autoresize )
-            videoWidget->setSize( *pi_width, *pi_height );
+            videoWidget->setSize( i_width, i_height );
     }
 }
 
diff --git a/modules/gui/qt/main_interface.hpp b/modules/gui/qt/main_interface.hpp
index 7c396ea..4ce7db0 100644
--- a/modules/gui/qt/main_interface.hpp
+++ b/modules/gui/qt/main_interface.hpp
@@ -70,7 +70,7 @@ public:
 
     /* Video requests from core */
     WId  getVideo( struct vout_window_t *,
-                   unsigned int *pi_width, unsigned int *pi_height, bool );
+                   unsigned int i_width, unsigned int i_height, bool );
     void releaseVideo( void );
     int  controlVideo( int i_query, va_list args );
 
@@ -200,7 +200,7 @@ public slots:
 
     /* Manage the Video Functions from the vout threads */
     void getVideoSlot( WId *p_id, struct vout_window_t *,
-                       unsigned *pi_width, unsigned *pi_height, bool );
+                       unsigned pi_width, unsigned pi_height, bool );
     void releaseVideoSlot( void );
 
     void emitBoss();
@@ -253,8 +253,7 @@ protected slots:
     void resumePlayback();
 
 signals:
-    void askGetVideo( WId *, struct vout_window_t *, unsigned *, unsigned *,
-                      bool );
+    void askGetVideo( WId *, struct vout_window_t *, unsigned, unsigned, bool );
     void askReleaseVideo( );
     void askVideoToResize( unsigned int, unsigned int );
     void askVideoSetFullScreen( bool );
diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp
index 6015b2a..3d1a4b2 100644
--- a/modules/gui/qt/qt.cpp
+++ b/modules/gui/qt/qt.cpp
@@ -735,10 +735,7 @@ static int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
     MainInterface *p_mi = p_intf->p_sys->p_mi;
     msg_Dbg( p_wnd, "requesting video window..." );
 
-    unsigned i_width = cfg->width;
-    unsigned i_height = cfg->height;
-
-    WId wid = p_mi->getVideo( p_wnd, &i_width, &i_height, cfg->is_fullscreen );
+    WId wid = p_mi->getVideo( p_wnd, cfg->width, cfg->height, cfg->is_fullscreen );
     if( !wid )
         return VLC_EGENERIC;
 



More information about the vlc-commits mailing list