]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
mpegts: store ATSC source_id to allow associating EIT
authorLauri Myllari <lauri.myllari@gmail.com>
Fri, 9 Jan 2015 18:08:06 +0000 (10:08 -0800)
committerJaroslav Kysela <perex@perex.cz>
Thu, 22 Oct 2015 15:33:58 +0000 (17:33 +0200)
src/input/mpegts.h
src/input/mpegts/dvb_psi.c
src/input/mpegts/mpegts_service.c

index bc748eb0a6aa9d42f2e6942b534d61541355afd8..0f61f3cabfee5a812245a1ffecebce91f962fa8c 100644 (file)
@@ -549,6 +549,7 @@ struct mpegts_service
   int      s_dvb_eit_enable;
   uint64_t s_dvb_opentv_chnum;
   uint16_t s_dvb_opentv_id;
+  uint16_t s_atsc_source_id;
 
   /*
    * Link to carrying multiplex and active adapter
index 194b5ecf7fd7ab0314bd6fa5d69ca227f8f7f7d5..01462520f6ac4d18613a20a7ce4e9a0d19eb5606 100644 (file)
@@ -1625,6 +1625,7 @@ atsc_vct_callback
   int i, r, sect, last, ver, extraid, save, dlen;
   int maj, min, count;
   uint16_t tsid, sid, type;
+  uint16_t srcid;
   char chname[256];
   mpegts_mux_t     *mm = mt->mt_mux, *mm_orig = mm;
   mpegts_network_t *mn = mm->mm_network;
@@ -1660,11 +1661,13 @@ atsc_vct_callback
     tsid = (ptr[22]) << 8 | ptr[23];
     sid  = (ptr[24]) << 8 | ptr[25];
     type = ptr[27] & 0x3f;
+    srcid  = (ptr[28]) << 8 | ptr[29];
     tvhdebug("vct", "tsid   %04X (%d)", tsid, tsid);
     tvhdebug("vct", "sid    %04X (%d)", sid, sid);
     tvhdebug("vct", "chname %s",    chname);
     tvhdebug("vct", "chnum  %d.%d", maj, min);
     tvhdebug("vct", "type   %02X (%d)", type, type);
+    tvhdebug("vct", "srcid  %04X (%d)", srcid, srcid);
 
     /* Skip */
     if (type > 3)
@@ -1687,6 +1690,11 @@ atsc_vct_callback
           s->s_dvb_channel_minor = min;
           save = 1;
         }
+        if (s->s_atsc_source_id != srcid) {
+          s->s_atsc_source_id = srcid;
+          save = 1;
+        }
+
         /* Save */
         if (save)
           s->s_config_save((service_t*)s);
index 77d446ffa7e40b821d119e70338d78777e5e11ef..7674968f3534f62d8f4e0c0b8bc0c82117b058a1 100644 (file)
@@ -137,6 +137,13 @@ const idclass_t mpegts_service_class =
       .opts     = PO_RDONLY,
       .off      = offsetof(mpegts_service_t, s_dvb_opentv_chnum),
     },
+    {
+      .type     = PT_U16,
+      .id       = "srcid",
+      .name     = "ATSC Source ID",
+      .opts     = PO_RDONLY,
+      .off      = offsetof(mpegts_service_t, s_atsc_source_id),
+    },
     {
       .type     = PT_STR,
       .id       = "svcname",