Browse Source

qt: medialib: reload asynchronously

On Qt view initialization completed, a medialibrary "reload" is
requested.

This call, which could take several seconds in practice (especially when
the medialibrary is initialized for the first time), was issued on
the UI thread, freezing the whole interface on starting.

Execute it from the Qt medialibrary thread pool instead.

Signed-off-by: Pierre Lamot <pierre@videolabs.io>
pull/119/head
Romain Vimont 6 years ago
committed by Pierre Lamot
parent
commit
1aeee76d91
  1. 1
      modules/gui/qt/maininterface/qml/MainDisplay.qml
  2. 4
      modules/gui/qt/medialibrary/medialib.cpp

1
modules/gui/qt/maininterface/qml/MainDisplay.qml

@ -47,6 +47,7 @@ Widgets.NavigableFocusScope {
Component.onCompleted: {
loadView()
if (medialib)
// asynchronous call
medialib.reload()
}

4
modules/gui/qt/medialibrary/medialib.cpp

@ -225,7 +225,9 @@ void MediaLib::insertIntoPlaylist(const size_t index, const QVariantList &itemId
void MediaLib::reload()
{
vlc_ml_reload_folder( vlcMl(), nullptr );
m_threadPool.start([ml = m_ml] {
vlc_ml_reload_folder(ml, nullptr);
});
}
vlc_medialibrary_t* MediaLib::vlcMl()

Loading…
Cancel
Save