add one more workaround for possible freezes (#96)

First of all it seems that freezes were caused by stuck dbus calls. I've
enabled dbus call timeout (build-configured, default to 3000 msec). And
moreover I've added one more thread lock for dbus calls.
This commit is contained in:
2016-06-17 15:19:00 +03:00
parent b20a96d32f
commit 0f1763cb81
4 changed files with 108 additions and 5 deletions

View File

@ -18,11 +18,16 @@
#ifndef PLAYERSOURCE_H
#define PLAYERSOURCE_H
#include <QMutex>
#include <QObject>
#include "abstractextsysmonsource.h"
#ifndef DBUS_CALL_TIMEOUT
#define DBUS_CALL_TIMEOUT 3000
#endif /* DBUS_CALL_TIMEOUT */
class QProcess;
class PlayerSource : public AbstractExtSysMonSource
@ -52,6 +57,7 @@ private:
QVariantHash m_mpdCached;
QProcess *m_mpdProcess = nullptr;
QString m_mpris;
QMutex m_dbusMutex;
QString m_player;
int m_symbols;
QStringList m_metadata = QStringList() << QString("album")