[player] Add log message if speaker_set() called with non-existent speaker id

Closes #1879
This commit is contained in:
ejurgensen 2025-03-28 22:24:19 +01:00
parent f108e531bb
commit 8e9e939e49
2 changed files with 5 additions and 1 deletions

View File

@ -610,7 +610,7 @@ outputs_device_get(uint64_t device_id)
return device;
}
DPRINTF(E_WARN, L_PLAYER, "Output device with id %" PRIu64 " has disappeared from our list\n", device_id);
DPRINTF(E_WARN, L_PLAYER, "Output device with id %" PRIu64 " is not in our list\n", device_id);
return NULL;
}

View File

@ -2683,6 +2683,10 @@ speaker_set(void *arg, int *retval)
// why we want to provide a max_volume.
max_volume = (player_state != PLAY_STOPPED) ? outputs_volume_get() : -1;
// Log a warning via outputs_device_get() if a speaker doesn't exist
for (i = 1; i <= nspk; i++)
outputs_device_get(ids[i]);
for (device = outputs_list(); device; device = device->next)
{
for (i = 1; i <= nspk; i++)