From 3ac344dbceef392ce4e2a16651b39fb34c57dc7b Mon Sep 17 00:00:00 2001 From: Bruno Morais Date: Thu, 5 Sep 2019 21:00:18 -0400 Subject: [PATCH] sleep & lock mutex --- src/plugins/mpris/mpris.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/mpris/mpris.cpp b/src/plugins/mpris/mpris.cpp index 11faab47e..437903659 100644 --- a/src/plugins/mpris/mpris.cpp +++ b/src/plugins/mpris/mpris.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include extern "C" { @@ -102,8 +103,10 @@ static class MPRISRemote : public IPlaybackRemote { void MPRISLoop() { while (!stop_processing) { if (bus) { + std::unique_lock lock(sd_mutex); while(sd_bus_process(bus, NULL) > 0); } + std::this_thread::sleep_for(std::chrono::milliseconds(10)); } }