mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-05 21:55:24 +00:00
use sd_bus_wait, no mutex
This commit is contained in:
parent
deeb06f6e3
commit
8824d01816
@ -3,7 +3,6 @@
|
||||
#include "dbus.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
|
||||
extern "C" {
|
||||
@ -125,10 +124,11 @@ void MPRISRemote::MPRISEmitSeek(double curpos) {
|
||||
void MPRISRemote::MPRISLoop() {
|
||||
while (!stop_processing) {
|
||||
if (bus) {
|
||||
std::unique_lock<decltype(sd_mutex)> 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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user