mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-05 21:55:24 +00:00
handle bus timeout properly
This commit is contained in:
parent
0dd348dd0e
commit
6c0b3b7952
@ -89,10 +89,9 @@ bool MPRISRemote::MPRISInit() {
|
||||
}
|
||||
|
||||
void MPRISRemote::MPRISDeinit() {
|
||||
if (this->bus) {
|
||||
sd_bus_unref(this->bus);
|
||||
bus = NULL;
|
||||
}
|
||||
|
||||
sd_bus_close_unref(this->bus);
|
||||
bus = NULL;
|
||||
stop_processing = true;
|
||||
if (thread) {
|
||||
thread->join();
|
||||
@ -125,9 +124,11 @@ void MPRISRemote::MPRISLoop() {
|
||||
while (!stop_processing) {
|
||||
if (bus) {
|
||||
if (sd_bus_process(bus, NULL) > 0) {
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
if (sd_bus_wait(bus, 500*1000) < 0) {
|
||||
break;
|
||||
}
|
||||
sd_bus_wait(bus, (uint64_t)-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user