From 8824d0181634afff1a0c382c876bc2d66fb4bf1e Mon Sep 17 00:00:00 2001 From: Bruno Morais Date: Mon, 9 Sep 2019 13:06:20 -0400 Subject: [PATCH] use sd_bus_wait, no mutex --- src/plugins/mpris/mpris.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/mpris/mpris.cpp b/src/plugins/mpris/mpris.cpp index 753204feb..5e9c2eec7 100644 --- a/src/plugins/mpris/mpris.cpp +++ b/src/plugins/mpris/mpris.cpp @@ -3,7 +3,6 @@ #include "dbus.h" #include #include -#include #include extern "C" { @@ -125,10 +124,11 @@ void MPRISRemote::MPRISEmitSeek(double curpos) { void MPRISRemote::MPRISLoop() { while (!stop_processing) { if (bus) { - std::unique_lock lock(sd_mutex); - while(sd_bus_process(bus, NULL) > 0); + if (sd_bus_process(bus, NULL) > 0) { + continue; + } + sd_bus_wait(bus, (uint64_t)-1); } - std::this_thread::sleep_for(std::chrono::milliseconds(10)); } }