From dab9089f8e4b056c5e81897280c592d4c9e95ad3 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Thu, 8 Aug 2024 00:20:38 +0200 Subject: [PATCH] [rcp] Fix for RCP devices not getting removed --- src/outputs/rcp.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/outputs/rcp.c b/src/outputs/rcp.c index 212a6897da..0c0bbf7fac 100644 --- a/src/outputs/rcp.c +++ b/src/outputs/rcp.c @@ -1298,18 +1298,17 @@ rcp_mdns_device_cb(const char *name, const char *type, const char *domain, const device->default_format = MEDIA_FORMAT_WAV; device->supported_formats = MEDIA_FORMAT_WAV | MEDIA_FORMAT_MP3 | MEDIA_FORMAT_ALAC; + // RCP/Roku Soundbridges only support ipv4 + device->v4_address = safe_strdup(address); + device->v4_port = port; // -1 if we are removing + if (port < 0 || !address) { ret = player_device_remove(device); } else { - // RCP/Roku Soundbridges only support ipv4 - device->v4_address = strdup(address); - device->v4_port = port; - DPRINTF(E_INFO, L_RCP, "Adding RCP output device '%s' at '%s'\n", name, address); - ret = player_device_add(device); }