]> git.sesse.net Git - vlc/commitdiff
Qt: fix multiple instances of a singleton if an input is already started
authorErwan Tulou <erwan10@videolan.org>
Wed, 11 Jun 2014 10:08:44 +0000 (12:08 +0200)
committerErwan Tulou <erwan10@videolan.org>
Wed, 11 Jun 2014 12:52:06 +0000 (14:52 +0200)
Using THEMIM at this level results in instantiating multiples copies of
what should be a singleton. This is because any preexisting input needs
to be initialized in the constructor of the THEMIN (MainInputManager). This
leads to recursively calling the constructor over and over.

This patch directly calls the underlying functions(no functional change).

modules/gui/qt4/input_manager.cpp

index 6b784384343c7637db09a8e90d4acc84d2f192d5..f72b3b35a9beb0e05483f1f0da2bc20b70f93ae0 100644 (file)
@@ -129,7 +129,7 @@ void InputManager::setInput( input_thread_t *_p_input )
             !var_GetFloat( p_input, "start-time" ) &&
             !var_GetFloat( p_input, "stop-time" ) )
         {
-            THEMIM->togglePlayPause();
+            playlist_Pause( THEPL );
 
             if( QMessageBox::question( NULL,
                         _("Continue playback?"),
@@ -138,7 +138,7 @@ void InputManager::setInput( input_thread_t *_p_input )
                     == QMessageBox::Yes )
                 var_SetTime( p_input, "time", (int64_t)i_time * 1000 );
 
-            THEMIM->togglePlayPause();
+            playlist_Play( THEPL );
         }
     }
     else