[vlc-commits] input_manager: Don't use THEMIM macro from input_manager

Hugo Beauzée-Luyssen git at videolan.org
Tue Apr 26 14:15:37 CEST 2016


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Apr 26 13:51:22 2016 +0200| [9ce2d2e076ec38166dea3234c5c09dc1b1ffa7d2] | committer: Hugo Beauzée-Luyssen

input_manager: Don't use THEMIM macro from input_manager

Store it internally instead. There's a 1:1 relation between the 2
instances.
Fix #16866

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

 modules/gui/qt/input_manager.cpp |   17 +++++++++--------
 modules/gui/qt/input_manager.hpp |    5 ++++-
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt/input_manager.cpp b/modules/gui/qt/input_manager.cpp
index 414f152..f6f6460 100644
--- a/modules/gui/qt/input_manager.cpp
+++ b/modules/gui/qt/input_manager.cpp
@@ -62,9 +62,10 @@ static inline void registerAndCheckEventIds( int start, int end )
  * But can also be used for VLM dialog or similar
  **********************************************************************/
 
-InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
-                           QObject( parent ), p_intf( _p_intf )
+InputManager::InputManager( MainInputManager *mim, intf_thread_t *_p_intf) :
+                           QObject( mim ), p_intf( _p_intf )
 {
+    p_mim        = mim;
     i_old_playing_status = END_S;
     oldName      = "";
     artUrl       = "";
@@ -87,7 +88,7 @@ InputManager::~InputManager()
 
 void InputManager::inputChangedHandler()
 {
-    setInput( THEMIM->getInput() );
+    setInput( p_mim->getInput() );
 }
 
 /* Define the Input used.
@@ -731,7 +732,7 @@ void InputManager::setArt( input_item_t *p_item, QString fileUrl )
     if( hasInput() )
     {
         char *psz_cachedir = config_GetUserDir( VLC_CACHE_DIR );
-        QString old_url = THEMIM->getIM()->decodeArtURL( p_item );
+        QString old_url = p_mim->getIM()->decodeArtURL( p_item );
         old_url = QDir( old_url ).canonicalPath();
 
         if( old_url.startsWith( QString::fromUtf8( psz_cachedir ) ) )
@@ -945,12 +946,12 @@ void InputManager::setAtoB()
 {
     if( !timeA )
     {
-        timeA = var_GetInteger( THEMIM->getInput(), "time"  );
+        timeA = var_GetInteger( p_mim->getInput(), "time"  );
     }
     else if( !timeB )
     {
-        timeB = var_GetInteger( THEMIM->getInput(), "time"  );
-        var_SetInteger( THEMIM->getInput(), "time" , timeA );
+        timeB = var_GetInteger( p_mim->getInput(), "time"  );
+        var_SetInteger( p_mim->getInput(), "time" , timeA );
         CONNECT( this, positionUpdated( float, int64_t, int ),
                  this, AtoBLoop( float, int64_t, int ) );
     }
@@ -968,7 +969,7 @@ void InputManager::setAtoB()
 void InputManager::AtoBLoop( float, int64_t i_time, int )
 {
     if( timeB && i_time >= timeB )
-        var_SetInteger( THEMIM->getInput(), "time" , timeA );
+        var_SetInteger( p_mim->getInput(), "time" , timeA );
 }
 
 /**********************************************************************
diff --git a/modules/gui/qt/input_manager.hpp b/modules/gui/qt/input_manager.hpp
index 6956134..e9339c1 100644
--- a/modules/gui/qt/input_manager.hpp
+++ b/modules/gui/qt/input_manager.hpp
@@ -120,13 +120,15 @@ private:
     int i_parent;
 };
 
+class MainInputManager;
+
 class InputManager : public QObject
 {
     Q_OBJECT
     friend class MainInputManager;
 
 public:
-    InputManager( QObject *, intf_thread_t * );
+    InputManager( MainInputManager *, intf_thread_t * );
     virtual ~InputManager();
 
     void delInput();
@@ -144,6 +146,7 @@ public:
 
 private:
     intf_thread_t  *p_intf;
+    MainInputManager* p_mim;
     input_thread_t *p_input;
     vlc_object_t   *p_input_vbi;
     input_item_t   *p_item;



More information about the vlc-commits mailing list