From 7c0474b743f5c6c34e94acf34e2b074f480a1aa9 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sun, 20 Nov 2022 22:38:33 +0100 Subject: [PATCH] [player] Don't stop/clear queue on speaker 'prevent-playback' or 'busy' When 'prevent-playback' or 'busy' is sent by a single playing speaker, we just want to pause playback and not clear the queue Closes #1553 --- src/outputs/airplay.c | 2 +- src/outputs/raop.c | 2 +- src/player.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/outputs/airplay.c b/src/outputs/airplay.c index d9ef0366..9bddc320 100644 --- a/src/outputs/airplay.c +++ b/src/outputs/airplay.c @@ -3705,7 +3705,7 @@ airplay_device_cb(const char *name, const char *type, const char *domain, const } } - DPRINTF(E_DBG, L_AIRPLAY, "Event for AirPlay device '%s' (port %d, id %" PRIx64 ")\n", name, port, id); + DPRINTF(E_DBG, L_AIRPLAY, "Event for AirPlay device '%s' (port %d, id %" PRIx64 ", Active-Remote %" PRIu32 ")\n", name, port, id, (uint32_t)id); devcfg = cfg_gettsec(cfg, "airplay", name); if (devcfg && cfg_getbool(devcfg, "exclude")) diff --git a/src/outputs/raop.c b/src/outputs/raop.c index 8a769139..14a99b36 100644 --- a/src/outputs/raop.c +++ b/src/outputs/raop.c @@ -4080,7 +4080,7 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha } device_name++; - DPRINTF(E_DBG, L_RAOP, "Event for AirPlay device '%s' (port %d, id %" PRIx64 ")\n", device_name, port, id); + DPRINTF(E_DBG, L_RAOP, "Event for AirPlay device '%s' (port %d, id %" PRIx64 ", Active-Remote %" PRIu32 ")\n", device_name, port, id, (uint32_t)id); devcfg = cfg_gettsec(cfg, "airplay", device_name); if (devcfg && cfg_getbool(devcfg, "exclude")) diff --git a/src/player.c b/src/player.c index ca95f9af..f485b8c3 100644 --- a/src/player.c +++ b/src/player.c @@ -2750,10 +2750,10 @@ speaker_prevent_playback_set_bh(void *arg, int *retval) { struct speaker_attr_param *param = arg; - if (outputs_sessions_count() == 0) + if (player_state == PLAY_PLAYING && outputs_sessions_count() == 0) { - DPRINTF(E_INFO, L_PLAYER, "Ending playback, speaker (id=%" PRIu64 ") set 'busy' or 'prevent-playback' flag\n", param->spk_id); - pb_abort(); // TODO Would be better for the user if we paused, but we don't have a handy function for that + DPRINTF(E_INFO, L_PLAYER, "Suspending playback, speaker (id=%" PRIu64 ") set 'busy' or 'prevent-playback' flag\n", param->spk_id); + pb_suspend(); // Don't want to use pb_abort here, since that may clear the queue } else status_update(player_state, LISTENER_SPEAKER | LISTENER_VOLUME);