Commit 45ecb694 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

qt4: Fix initial input probing

inputChangedHandler only reads from the current MIM input, which isn't
set until the next playlist callback is received.
This actively probes the current input, sets it, and inform potential
listeners
refs #14162
parent a375caeb
......@@ -1061,7 +1061,11 @@ void MainInputManager::customEvent( QEvent *event )
default:
if( type != IMEvent::ItemChanged ) return;
}
probeCurrentInput();
}
void MainInputManager::probeCurrentInput()
{
if( p_input != NULL )
vlc_object_release( p_input );
p_input = playlist_CurrentInput( THEPL );
......
......@@ -271,6 +271,9 @@ public:
bool hasEmptyPlaylist();
void requestVoutUpdate() { return im->UpdateVout(); }
// Probe for initial input. Doing this from the constructor would cause
// the getInstance to call itself recursively from the inputChangedHandler
void probeCurrentInput();
protected:
QSignalMapper *menusAudioMapper;
......
......@@ -514,11 +514,8 @@ static void *Thread( void *obj )
/* Initialize the Dialog Provider and the Main Input Manager */
DialogsProvider::getInstance( p_intf );
MainInputManager *mim = MainInputManager::getInstance( p_intf );
/* initialize p_input (an input can already be running) */
input_thread_t *p_input = playlist_CurrentInput( THEPL );
if( p_input )
mim->getIM()->inputChangedHandler();
MainInputManager* mim = MainInputManager::getInstance( p_intf );
mim->probeCurrentInput();
#ifdef UPDATE_CHECK
/* Checking for VLC updates */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment