Linux TvHeadend Mux flip flopping
#7
@negge I'm happy to do that, but as the TVHeadEnd DVB stuff has (or is) been all be rewritten this is a bit of a dead end ... I had a quick look at the later sources and it did appear to be considering the sat position before updating muxes. A new user should start from that.

But, if anyone really wants this change, here is (the short) list of diffs against version 3.5.247

Code:
diff -urBN tvheadend/src/dvb/dvb.h mytvheadend/src/dvb/dvb.h
--- tvheadend/src/dvb/dvb.h     2014-03-25 13:42:13.061401084 +1300
+++ mytvheadend/src/dvb/dvb.h   2014-03-25 13:39:52.101395736 +1300
@@ -59,6 +59,7 @@
   char *sc_name;
   char *sc_comment;
   char *sc_lnb;
+  int  sc_position;

   struct th_dvb_mux_instance_list sc_tdmis;

@@ -83,6 +84,7 @@
typedef struct dvb_mux_conf {
   dvb_frontend_parameters_t dmc_fe_params;
   int dmc_polarisation;
+  int dmc_position;
   dvb_satconf_t *dmc_satconf;
#if DVB_API_VERSION >= 5
   fe_modulation_t dmc_fe_modulation;


diff -urBN tvheadend/src/dvb/dvb_multiplex.c mytvheadend/src/dvb/dvb_multiplex.c
--- tvheadend/src/dvb/dvb_multiplex.c   2014-03-25 13:42:13.061401084 +1300
+++ mytvheadend/src/dvb/dvb_multiplex.c 2014-03-25 13:47:54.369414033 +1300
@@ -109,7 +109,8 @@
   fd = labs(fd);
   return fd < 2000 &&
     a->dmc_polarisation             == b->dmc_polarisation &&
-    a->dmc_satconf                  == satconf;
+    a->dmc_satconf                  == satconf &&
+    a->dmc_satconf->sc_position     == b->dmc_position;
}


diff -urBN tvheadend/src/dvb/dvb_satconf.c mytvheadend/src/dvb/dvb_satconf.c
--- tvheadend/src/dvb/dvb_satconf.c     2014-03-25 13:42:13.061401084 +1300
+++ mytvheadend/src/dvb/dvb_satconf.c   2014-03-24 15:37:25.126385215 +1300
@@ -75,6 +75,7 @@
   sc = calloc(1, sizeof(dvb_satconf_t));
   sc->sc_id = strdup(id);
   sc->sc_lnb = strdup("Universal");
+  sc->sc_position = 1600;
   TAILQ_INSERT_TAIL(&tda->tda_satconfs, sc, sc_adapter_link);

   return sc;
@@ -115,6 +116,7 @@
   htsmsg_add_str(m, "name", sc->sc_name ?: "");
   htsmsg_add_str(m, "comment", sc->sc_comment ?: "");
   htsmsg_add_str(m, "lnb", sc->sc_lnb);
+  htsmsg_add_u32(m, "position", sc->sc_position);
   return m;
}

@@ -139,5 +141,8 @@
   tvh_str_update(&sc->sc_comment, htsmsg_get_str(values, "comment"));
   tvh_str_update(&sc->sc_lnb, htsmsg_get_str(values, "lnb"));

+  if(!htsmsg_get_u32(values, "position", &u32))
+    sc->sc_position = u32;
+
   if(!htsmsg_get_u32(values, "port", &u32))
     sc->sc_port = u32;


diff -urBN tvheadend/src/dvb/dvb_tables.c mytvheadend/src/dvb/dvb_tables.c
--- tvheadend/src/dvb/dvb_tables.c      2014-03-25 13:42:13.065401084 +1300
+++ mytvheadend/src/dvb/dvb_tables.c    2014-03-25 13:53:37.033427034 +1300
@@ -712,9 +712,7 @@
{
   int freq, symrate;
   struct dvb_mux_conf dmc;
-#if ENABLE_TRACE
   uint16_t orbital_pos;
-#endif

   if(len < 11)
     return -1;
@@ -733,11 +731,11 @@
     return -1;
   }

-#if ENABLE_TRACE
   orbital_pos = bcdtoint(ptr[4]) * 100 + bcdtoint(ptr[5]);
-#endif
+#if ENABLE_TRACE
   tvhtrace("nit", "    orbital pos %d", orbital_pos);
-
+#endif
+  dmc.dmc_position = orbital_pos;
   symrate =
     bcdtoint(ptr[7]) * 100000 + bcdtoint(ptr[8]) * 1000 +
     bcdtoint(ptr[9]) * 10     + (ptr[10] >> 4);


diff -urBN tvheadend/src/webui/static/app/dvb.js mytvheadend/src/webui/static/app/dvb.js
--- tvheadend/src/webui/static/app/dvb.js       2014-03-25 13:42:13.089401085 +1300
+++ mytvheadend/src/webui/static/app/dvb.js     2014-03-24 15:08:44.242319922 +1300
@@ -1429,6 +1429,13 @@
                        maxValue : 63
                })
        }, {
+               header : "Orbital Position",
+               dataIndex : 'position',
+               editor : new fm.NumberField({
+                       minValue : 0,
+                       maxValue : 1800
+               })
+       }, {
                header : "LNB type",
                dataIndex : 'lnb',
                width : 200,
@@ -1449,7 +1456,7 @@
                editor : new fm.TextField()
        } ]});

-       var rec = Ext.data.Record.create([ 'name', 'port', 'comment', 'lnb' ]);
+    var rec = Ext.data.Record.create([ 'name', 'port', 'comment', 'lnb', 'position' ]);

        return new tvheadend.tableEditor('Satellite config', 'dvbsatconf/'
                + adapterId, cm, rec, null, null, null);
Reply


Messages In This Thread
TvHeadend Mux flip flopping - by redstorm - 2014-02-24, 20:53
RE: TvHeadend Mux flip flopping - by negge - 2014-02-26, 23:57
RE: TvHeadend Mux flip flopping - by redstorm - 2014-03-22, 09:45
RE: TvHeadend Mux flip flopping - by negge - 2014-03-22, 23:20
RE: TvHeadend Mux flip flopping - by djaggar - 2014-03-24, 12:36
RE: TvHeadend Mux flip flopping - by negge - 2014-03-24, 22:19
RE: TvHeadend Mux flip flopping - by djaggar - 2014-03-26, 01:33
RE: TvHeadend Mux flip flopping - by redstorm - 2014-03-27, 00:45
Logout Mark Read Team Forum Stats Members Help
TvHeadend Mux flip flopping0