]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add ability to force start of an DVB transport, needed for probing
authorAndreas Öman <andreas@lonelycoder.com>
Sat, 17 May 2008 09:30:41 +0000 (09:30 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Sat, 17 May 2008 09:30:41 +0000 (09:30 +0000)
avgen.c
dvb_dvr.c
dvb_dvr.h
file_input.c
iptv_input.c
serviceprobe.c
transports.c
transports.h
tvhead.h
v4l.c

diff --git a/avgen.c b/avgen.c
index d82f222cdd4bc4cdc4bc5c9cd7d8a375002ca591..d579eb979251c61e5df3108bd07779b5166f172e 100644 (file)
--- a/avgen.c
+++ b/avgen.c
@@ -76,7 +76,7 @@ static void avgen_deliver(th_transport_t *t, avgen_t *avg, int64_t clk);
 static void avgen_stop_feed(th_transport_t *t);
 
 static int avgen_start_feed(th_transport_t *t, unsigned int weight,
-                           int status);
+                           int status, int force_start);
 
 static void update_video(avgen_t *avg, int vframe, int framerate);
 static void update_audio(avgen_t *avg, int vframe, int framerate);
@@ -174,7 +174,8 @@ rgb2yuv(uint8_t yuv[3], const uint8_t rgb[3])
  *
  */
 static int 
-avgen_start_feed(th_transport_t *t, unsigned int weight, int status)
+avgen_start_feed(th_transport_t *t, unsigned int weight, int status,
+                int force_start)
 {
   avgen_t *avg;
   AVCodecContext *avctx;
index 88b8198c532e9108a463ca4b19a3e8b093d4bb8b..42b7b8c202aa9a346e6d9a5d21dad58730f4f7c9 100644 (file)
--- a/dvb_dvr.c
+++ b/dvb_dvr.c
@@ -137,7 +137,8 @@ dvb_stop_feed(th_transport_t *t)
  * transports that is subscribing to the adapter
  */
 int
-dvb_start_feed(th_transport_t *t, unsigned int weight, int status)
+dvb_start_feed(th_transport_t *t, unsigned int weight, int status, 
+              int force_start)
 {
   struct dmx_pes_filter_params dmx_param;
   th_stream_t *st;
@@ -150,7 +151,7 @@ dvb_start_feed(th_transport_t *t, unsigned int weight, int status)
 
   /* Check if adapter is idle, or already tuned */
 
-  if(tdmi != NULL && tdmi != t->tht_dvb_mux_instance) {
+  if(tdmi != NULL && tdmi != t->tht_dvb_mux_instance && !force_start) {
 
     /* Nope .. */
 
index ec0052643226ca7d321ccdff7e3dccf81c00dff1..8ff3eea2a61cb33604b52af2a6e11269a7d1e34c 100644 (file)
--- a/dvb_dvr.h
+++ b/dvb_dvr.h
@@ -21,7 +21,8 @@
 
 int dvb_dvr_init(th_dvb_adapter_t *tda);
 
-int dvb_start_feed(struct th_transport *t, unsigned int weight, int status);
+int dvb_start_feed(struct th_transport *t, unsigned int weight, int status,
+                  int force_start);
 
 void dvb_stop_feed(th_transport_t *t);
 
index 28cf6a489b20f7e7e40b577552ecb0037ce778d6..98befac9432e069e7fc19e551a8acdf021b63ebe 100644 (file)
@@ -61,7 +61,7 @@ typedef struct file_input {
 static void file_input_stop_feed(th_transport_t *t);
 
 static int file_input_start_feed(th_transport_t *t, unsigned int weight,
-                                int status);
+                                int status, int force_start);
 
 static void fi_deliver(void *aux, int64_t now);
 
@@ -191,7 +191,8 @@ file_input_reset(th_transport_t *t, file_input_t *fi)
  *
  */
 static int 
-file_input_start_feed(th_transport_t *t, unsigned int weight, int status)
+file_input_start_feed(th_transport_t *t, unsigned int weight, int status,
+                     int force_start)
 {
   file_input_t *fi = t->tht_file_input;
   
index 209dab7c5f1a260aec799eddabe33ebb7411698e..2858668ac013bafdc0dc90d301addcb8f39afb3d 100644 (file)
@@ -68,7 +68,7 @@ iptv_fd_callback(int events, void *opaque, int fd)
 }
 
 static int
-iptv_start_feed(th_transport_t *t, unsigned int weight, int status)
+iptv_start_feed(th_transport_t *t, unsigned int weight, int status, int force)
 {
   int fd;
   struct ip_mreqn m;
@@ -253,7 +253,7 @@ static void
 iptv_probe_transport(th_transport_t *t)
 {
   syslog(LOG_INFO, "iptv: Probing transport %s", t->tht_name);
-  iptv_start_feed(t, 1, TRANSPORT_PROBING);
+  iptv_start_feed(t, 1, TRANSPORT_PROBING, 1);
 }
 
 
index fcb6870f6469148842744bd2ddcf423e5ad86b3c..37572abb0cfc51638ca80212f100a8117ce09133 100644 (file)
@@ -184,7 +184,7 @@ serviceprobe_start(void *aux, int64_t now)
 
 
   if(t->tht_runstatus != TRANSPORT_RUNNING)
-    transport_start(t, INT32_MAX);
+    transport_start(t, INT32_MAX, 1);
 
   s->ths_transport = t;
   LIST_INSERT_HEAD(&t->tht_subscriptions, s, ths_transport_link);
index f2dc3e62fcedde073aa9014578cf865aa25a1074..f71ae5847c7576be133affb224ea5fbccfd2f6f1 100644 (file)
@@ -157,7 +157,7 @@ transport_stop(th_transport_t *t, int flush_subscriptions)
  *
  */
 int
-transport_start(th_transport_t *t, unsigned int weight)
+transport_start(th_transport_t *t, unsigned int weight, int force_start)
 {
   th_stream_t *st;
   AVCodec *c;
@@ -165,7 +165,7 @@ transport_start(th_transport_t *t, unsigned int weight)
 
   assert(t->tht_runstatus != TRANSPORT_RUNNING);
 
-  if(t->tht_start_feed(t, weight, TRANSPORT_RUNNING))
+  if(t->tht_start_feed(t, weight, TRANSPORT_RUNNING, force_start))
     return -1;
 
   t->tht_monitor_suspend = 10;
@@ -313,7 +313,7 @@ transport_find(channel_t *ch, unsigned int weight)
     if(t->tht_runstatus == TRANSPORT_RUNNING) 
       return t;
 
-    if(!transport_start(t, 0))
+    if(!transport_start(t, 0, 0))
       return t;
   }
 
@@ -322,7 +322,7 @@ transport_find(channel_t *ch, unsigned int weight)
 
   for(i = 0; i < cnt; i++) {
     t = vec[i];
-    if(!transport_start(t, weight))
+    if(!transport_start(t, weight, 0))
       return t;
   }
   return NULL;
index 6422911469bddbbe285c970bc12d6964d7938815..807e840db525baeb564074e8c4f08b96bfc95dad 100644 (file)
@@ -23,7 +23,7 @@
 
 unsigned int transport_compute_weight(struct th_transport_list *head);
 
-int transport_start(th_transport_t *t, unsigned int weight);
+int transport_start(th_transport_t *t, unsigned int weight, int force_start);
 
 void transport_stop(th_transport_t *t, int flush_subscriptions);
 
index f41639c926a86f47956b99e6d56bcd7b42f1508c..4045dfa25e96531411a9b588b9f4e684f7e2d682 100644 (file)
--- a/tvhead.h
+++ b/tvhead.h
@@ -436,7 +436,7 @@ typedef struct th_transport {
   LIST_HEAD(, th_subscription) tht_subscriptions;
 
   int (*tht_start_feed)(struct th_transport *t, unsigned int weight,
-                       int status);
+                       int status, int force_start);
 
   void (*tht_stop_feed)(struct th_transport *t);
 
diff --git a/v4l.c b/v4l.c
index 78f4de180f115bcaa46e0730e85a917481223f8c..76e9b32a4ceddf96ce3e644b4c7b6ec3ccbc1d1b 100644 (file)
--- a/v4l.c
+++ b/v4l.c
@@ -53,7 +53,8 @@ static void v4l_add_adapter(const char *path);
 
 static void v4l_stop_feed(th_transport_t *t);
 
-static int v4l_start_feed(th_transport_t *t, unsigned int weight, int status);
+static int v4l_start_feed(th_transport_t *t, unsigned int weight, int status,
+                         int force_start);
 
 /* 
  *
@@ -232,7 +233,8 @@ v4l_adapter_clean(th_v4l_adapter_t *tva)
  *
  */
 static int 
-v4l_start_feed(th_transport_t *t, unsigned int weight, int status)
+v4l_start_feed(th_transport_t *t, unsigned int weight, int status,
+              int force_start)
 {
   th_v4l_adapter_t *tva, *cand = NULL;
   int w, fd;