]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Allow MUX retune after editing when tune_failed
authorTrujulu <trujulu@gmail.com>
Tue, 6 Jan 2026 11:41:48 +0000 (12:41 +0100)
committerFlole <Flole998@users.noreply.github.com>
Fri, 9 Jan 2026 23:39:35 +0000 (00:39 +0100)
Currently, when a MUX instance is marked as mmi_tune_failed, it is not being reset. Because of this, after editing the MUX and correcting its parameters, the MUX cannot be used anymore unless the system is restarted. This issue is addressed by setting mmi->mmi_tune_failed to 0 whenever the MUX is saved.

This can be easily reproduced by setting an out-of-range frequency on any Linux DVB tuner and then trying to play with the MUX settings.

src/input/mpegts/mpegts_mux.c

index fa966fdcedba819e98f0687b2e94619429655aa2..695910a6f96024739cd238dc447775cebd2739ef 100644 (file)
@@ -1295,12 +1295,16 @@ void
 mpegts_mux_save ( mpegts_mux_t *mm, htsmsg_t *c, int refs )
 {
   mpegts_service_t *ms;
+  mpegts_mux_instance_t *mmi;
   htsmsg_t *root = !refs ? htsmsg_create_map() : c;
   htsmsg_t *services = !refs ? htsmsg_create_map() : htsmsg_create_list();
   htsmsg_t *e;
   char ubuf[UUID_HEX_SIZE];
 
   idnode_save(&mm->mm_id, root);
+  LIST_FOREACH(mmi, &mm->mm_instances, mmi_mux_link) {
+    mmi->mmi_tune_failed = 0;
+  }
   LIST_FOREACH(ms, &mm->mm_services, s_dvb_mux_link) {
     if (refs) {
       htsmsg_add_uuid(services, NULL, &ms->s_id.in_uuid);