]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Preserve existing Unicable idnode during the set operation
authorPeter Bašista <pbasista@gmail.com>
Sun, 15 Jan 2023 19:31:55 +0000 (20:31 +0100)
committerFlole998 <Flole998@users.noreply.github.com>
Tue, 17 Jan 2023 02:32:34 +0000 (03:32 +0100)
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.

src/input/mpegts/linuxdvb/linuxdvb_satconf.c

index fdc2562a1e73b1498f2d9caa6f682a09d0e01892..ffbfe0f691b96710c5089299358f2c34220a574e 100644 (file)
@@ -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);