diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2017-10-10 15:33:14 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2017-10-11 13:33:39 +0000 |
commit | 5e09399775bbcdfae9a89f0010000e97ff8d23ae (patch) | |
tree | 9a369d133b029c0c7dec1d005e771178d6a089b2 | |
parent | 24ce34aa33a156d95b1e4fe20234afd829b710f6 (diff) | |
download | qtivi-5e09399775bbcdfae9a89f0010000e97ff8d23ae.tar.gz |
Fix crash in the indexer caused by QtMultimedia not being thread-safe
Also register the IndexerStatus enum to make it work over thread boundaries.
Change-Id: I80a955c488a41599dc87ca167e6465269600db67
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
-rw-r--r-- | src/ivimedia/qivimediaindexercontrol.cpp | 1 | ||||
-rw-r--r-- | src/plugins/ivimedia/media_simulator/mediaindexerbackend.cpp | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/ivimedia/qivimediaindexercontrol.cpp b/src/ivimedia/qivimediaindexercontrol.cpp index baae4bb..fba42fe 100644 --- a/src/ivimedia/qivimediaindexercontrol.cpp +++ b/src/ivimedia/qivimediaindexercontrol.cpp @@ -137,6 +137,7 @@ QIviMediaIndexerControlBackendInterface *QIviMediaIndexerControlPrivate::indexer QIviMediaIndexerControl::QIviMediaIndexerControl(QObject *parent) : QIviAbstractFeature(*new QIviMediaIndexerControlPrivate(QLatin1String(QIviMediaIndexer_iid), this), parent) { + qRegisterMetaType<QIviMediaIndexerControl::State>(); } /*! diff --git a/src/plugins/ivimedia/media_simulator/mediaindexerbackend.cpp b/src/plugins/ivimedia/media_simulator/mediaindexerbackend.cpp index 06c7d30..faba4c7 100644 --- a/src/plugins/ivimedia/media_simulator/mediaindexerbackend.cpp +++ b/src/plugins/ivimedia/media_simulator/mediaindexerbackend.cpp @@ -143,7 +143,9 @@ bool MediaIndexerBackend::scanWorker(const QString &mediaDir, bool removeData) qInfo() << "Scanning path: " << mediaDir; +#ifndef QT_TAGLIB QMediaPlayer player; +#endif QSqlQuery query(m_db); bool ret = query.exec("CREATE TABLE IF NOT EXISTS track " |