]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Keep track of the format the source arrives in. This way MPEG TS output muxes can...
authorAndreas Öman <andreas@lonelycoder.com>
Mon, 7 Jan 2008 16:36:05 +0000 (16:36 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Mon, 7 Jan 2008 16:36:05 +0000 (16:36 +0000)
avgen.c
channels.c
dvb.c
dvb_muxconfig.c
iptv_input.c
transports.c
transports.h
tvhead.h
v4l.c

diff --git a/avgen.c b/avgen.c
index f13e6ed85982682f00899b3bb0ad7f34ca87be8f..a271f930a698ba2bf9c5ed65cf819e578ea2d46b 100644 (file)
--- a/avgen.c
+++ b/avgen.c
@@ -118,7 +118,7 @@ avgen_init(void)
 
   t->tht_uniquename = strdup("TEST1");
 
-  transport_link(t, ch);
+  transport_link(t, ch, THT_OTHER);
 }
 
 
index 8d16bef6a12819d05e94bf07142bd75853a2052c..318a7d28cbdbf529ade6ed94722518b2a8ec00d5 100644 (file)
@@ -239,18 +239,6 @@ service_load(struct config_head *head)
     free(t);
 }
 
-/**
- *
- */
-void
-transport_link(th_transport_t *t, th_channel_t *ch)
-{
-  transport_set_channel(t, ch);
-  transport_monitor_init(t);
-  LIST_INSERT_HEAD(&all_transports, t, tht_global_link);
-}
-
-
 /**
  *
  */
diff --git a/dvb.c b/dvb.c
index 97518379949d0fac18e0d9c4e5acba740e3a3a95..762ce9594afa1aacc829fef160ceeac8fc679246 100644 (file)
--- a/dvb.c
+++ b/dvb.c
@@ -168,7 +168,7 @@ dvb_find_transport(th_dvb_mux_instance_t *tdmi, uint16_t tid,
     return NULL;
 
   t = calloc(1, sizeof(th_transport_t));
-  transport_monitor_init(t);
+  transport_init(t, THT_MPEG_TS);
 
   t->tht_dvb_transport_id = tid;
   t->tht_dvb_service_id   = sid;
index 6c3970549058e521dbb3740e907bc226d794e830..497437630082f331bf7a98ce1a4c4a27e9978b60 100644 (file)
@@ -338,7 +338,7 @@ dvb_configure_transport(th_transport_t *t, const char *muxname,
   t->tht_dvb_mux = tdm;
   t->tht_name = strdup(tdm->tdm_title);
 
-  transport_link(t, channel_find(channel_name, 1, NULL));
+  transport_link(t, channel_find(channel_name, 1, NULL), THT_MPEG_TS);
   return 0;
 }
 
index 80e0a7126c3dace8dba930a12c397790d78966b2..c0711f1b07dbd284e24e0575868fa8a4c42589ac 100644 (file)
@@ -286,7 +286,7 @@ iptv_probe_done(th_transport_t *t, int timeout)
   iptv_stop_feed(t);
 
   if(!timeout)
-    transport_link(t, t->tht_channel);
+    transport_link(t, t->tht_channel, THT_MPEG_TS);
   else
     LIST_INSERT_HEAD(&iptv_stale_transports, t, tht_adapter_link);
 
index a726273921c3ec5394ab960d59ed572585fc9a3a..fbb7823c0f54f1df27f5178a54039d224cfa676e 100644 (file)
@@ -329,9 +329,14 @@ transport_monitor(void *aux, int64_t now)
 }
 
 
+/**
+ *
+ */
 void
-transport_monitor_init(th_transport_t *t)
+transport_init(th_transport_t *t, int source_type)
 {
+  t->tht_source_type = source_type;
+
   avgstat_init(&t->tht_cc_errors, 3600);
   avgstat_init(&t->tht_rate, 10);
 
@@ -339,6 +344,19 @@ transport_monitor_init(th_transport_t *t)
 }
 
 
+/**
+ *
+ */
+void
+transport_link(th_transport_t *t, th_channel_t *ch, int source_type)
+{
+  transport_set_channel(t, ch);
+  transport_init(t, source_type);
+  LIST_INSERT_HEAD(&all_transports, t, tht_global_link);
+}
+
+
+
 th_stream_t *
 transport_add_stream(th_transport_t *t, int pid, tv_streamtype_t type)
 {
index 246bd31b877534931cfdfd40053cb68cd8b45b5f..ae5c5ecd7a0730393ffb002118f42dd744372edf 100644 (file)
@@ -25,11 +25,11 @@ unsigned int transport_compute_weight(struct th_transport_list *head);
 
 void transport_stop(th_transport_t *t, int flush_subscriptions);
 
-void transport_monitor_init(th_transport_t *t);
+void transport_init(th_transport_t *t, int source_type);
 
-int transport_set_channel(th_transport_t *th, th_channel_t *ch);
+void transport_link(th_transport_t *t, th_channel_t *ch, int source_type);
 
-void transport_link(th_transport_t *t, th_channel_t *ch);
+int transport_set_channel(th_transport_t *t, th_channel_t *ch);
 
 th_transport_t *transport_find(th_channel_t *ch, unsigned int weight);
 
index ffa5cf9ce1c0610e42cac6d24831197d08c1610d..3611b2c199b40f8c68560ffd9ac46570ade0eb3e 100644 (file)
--- a/tvhead.h
+++ b/tvhead.h
@@ -442,6 +442,11 @@ typedef struct th_transport {
   const char *tht_uniquename;
   const char *tht_network;
 
+  enum {
+    THT_MPEG_TS,
+    THT_OTHER,
+  } tht_source_type;
+
 } th_transport_t;
 
 
diff --git a/v4l.c b/v4l.c
index 730e9f8848561721c5d32aa57d6dd7c506c4b35b..b28e34bd9276c2d330e0f10380b0ea1cca6454ee 100644 (file)
--- a/v4l.c
+++ b/v4l.c
@@ -101,7 +101,7 @@ v4l_configure_transport(th_transport_t *t, const char *muxname,
   snprintf(buf, sizeof(buf), "ANALOG:%u", t->tht_v4l_frequency);
   t->tht_uniquename = strdup(buf);
 
-  transport_link(t, channel_find(channel_name, 1, NULL));
+  transport_link(t, channel_find(channel_name, 1, NULL), THT_OTHER);
   return 0;
 }