From: Peter BaĊĦista Date: Sun, 15 Jan 2023 19:31:55 +0000 (+0100) Subject: Preserve existing Unicable idnode during the set operation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11358ba2537c988c940a46500434417b7cf98f0f;p=thirdparty%2Ftvheadend.git Preserve existing Unicable idnode during the set operation Currently, the Unicable settings are always cleared when enabling or disabling the corresponding satellite position or its owning adapter. The reason is that the idnode with Unicable configuration is always unconditionally deleted during the "set" operation. This change adds a check for the existing Unicable configuration and preserves the existing idnode if its type remains the same. The same logic is already used when changing the configuration related to LNB, switch and rotor. --- diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index fdc2562a1..ffbfe0f69 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -1426,6 +1426,8 @@ linuxdvb_satconf_ele_class_en50494type_set ( void *o, const void *p ) { linuxdvb_satconf_ele_t *ls = o; const char *str = p; + if (ls->lse_en50494 && !strcmp(str ?: "", ls->lse_en50494->ld_type)) + return 0; if (ls->lse_en50494) linuxdvb_en50494_destroy(ls->lse_en50494); ls->lse_en50494 = linuxdvb_en50494_create0(str, NULL, ls, 0);