Add call to check if the dbus service is started.

This commit is contained in:
Mike Brady
2019-02-08 22:31:50 +00:00
parent 58acd161cd
commit 97a4766e93
4 changed files with 26 additions and 2 deletions
+12 -2
View File
@@ -67,13 +67,18 @@ void going_active(int block) {
#endif
#ifdef CONFIG_DBUS_INTERFACE
if (dbus_service_is_running())
shairport_sync_set_active(SHAIRPORT_SYNC(shairportSyncSkeleton), TRUE);
#endif
if (config.disable_standby_mode == disable_standby_while_active) {
config.keep_dac_busy = 1;
#ifdef CONFIG_DBUS_INTERFACE
if (dbus_service_is_running())
shairport_sync_set_disable_standby(SHAIRPORT_SYNC(shairportSyncSkeleton), TRUE);
else
config.keep_dac_busy = 1;
#else
config.keep_dac_busy = 1;
#endif
}
}
@@ -89,13 +94,18 @@ void going_inactive(int block) {
#endif
#ifdef CONFIG_DBUS_INTERFACE
if (dbus_service_is_running())
shairport_sync_set_active(SHAIRPORT_SYNC(shairportSyncSkeleton), FALSE);
#endif
if (config.disable_standby_mode == disable_standby_while_active) {
config.keep_dac_busy = 0;
#ifdef CONFIG_DBUS_INTERFACE
if (dbus_service_is_running())
shairport_sync_set_disable_standby(SHAIRPORT_SYNC(shairportSyncSkeleton), FALSE);
else
config.keep_dac_busy = 0;
#else
config.keep_dac_busy = 0;
#endif
}
}