mirror of
https://github.com/clangen/musikcube.git
synced 2024-10-02 04:52:32 +00:00
lock mutex in other places
This commit is contained in:
parent
046b6954ee
commit
0348082c16
@ -84,6 +84,7 @@ static class MPRISRemote : public IPlaybackRemote {
|
|||||||
void MPRISEmitChange(MPRISProperty prop) {
|
void MPRISEmitChange(MPRISProperty prop) {
|
||||||
if (bus) {
|
if (bus) {
|
||||||
char** strv = (char**)(&MPRISPropertyNames.at(prop));
|
char** strv = (char**)(&MPRISPropertyNames.at(prop));
|
||||||
|
std::unique_lock<decltype(sd_mutex)> lock(sd_mutex);
|
||||||
sd_bus_emit_properties_changed_strv(bus, "/org/mpris/MediaPlayer2",
|
sd_bus_emit_properties_changed_strv(bus, "/org/mpris/MediaPlayer2",
|
||||||
"org.mpris.MediaPlayer2.Player",
|
"org.mpris.MediaPlayer2.Player",
|
||||||
strv);
|
strv);
|
||||||
@ -94,6 +95,7 @@ static class MPRISRemote : public IPlaybackRemote {
|
|||||||
void MPRISEmitSeek(double curpos) {
|
void MPRISEmitSeek(double curpos) {
|
||||||
if (bus) {
|
if (bus) {
|
||||||
int64_t position = (int64_t)(curpos*1000*1000);
|
int64_t position = (int64_t)(curpos*1000*1000);
|
||||||
|
std::unique_lock<decltype(sd_mutex)> lock(sd_mutex);
|
||||||
sd_bus_emit_signal(bus, "/org/mpris/MediaPlayer2",
|
sd_bus_emit_signal(bus, "/org/mpris/MediaPlayer2",
|
||||||
"org.mpris.MediaPlayer2.Player",
|
"org.mpris.MediaPlayer2.Player",
|
||||||
"Seeked", "x", position);
|
"Seeked", "x", position);
|
||||||
|
Loading…
Reference in New Issue
Block a user