summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-06-06 20:25:25 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-06-07 04:27:30 +0000
commit160ea90be4220b9c1e1e062f054cde1a6a8ddb52 (patch)
tree501c70cff0e07a9712d6a39e5b0800f49d4db047 /app
parenta8ffd11ac30a9c7cba729dc2c90005470c48c2a4 (diff)
mediaplayer: workaround race condition with agl-service-mediaplayer service
On some startups the agl-service-mediaplayer triggers an event during QML + UI load which causes it to be dropped. Delaying for 300 milliseconds seems to workaround this issue, but needs to be replaced with a proper method in the future. Bug-AGL: SPEC-1496 Change-Id: Iefd825f79b19c422a153b3d77b4d3a472c13c372 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app')
-rw-r--r--app/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/main.cpp b/app/main.cpp
index fa7fe61..af98e44 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -31,6 +31,8 @@
#include <bluetooth.h>
#include <mediaplayer.h>
+#include <unistd.h>
+
int main(int argc, char *argv[])
{
QString myname = QString("Music");
@@ -98,6 +100,9 @@ int main(int argc, char *argv[])
context->setContextProperty("mediaplayer", new Mediaplayer(bindingAddress));
context->setContextProperty("bluetooth_connection", new Bluetooth(bindingAddress));
+
+ usleep(300000);
+
engine.load(QUrl(QStringLiteral("qrc:/MediaPlayer.qml")));
QObject *root = engine.rootObjects().first();
QQuickWindow *window = qobject_cast<QQuickWindow *>(root);