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);
*
*/
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;
* 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;
/* 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 .. */
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);
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);
*
*/
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;
}
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;
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);
}
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);
*
*/
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;
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;
if(t->tht_runstatus == TRANSPORT_RUNNING)
return t;
- if(!transport_start(t, 0))
+ if(!transport_start(t, 0, 0))
return t;
}
for(i = 0; i < cnt; i++) {
t = vec[i];
- if(!transport_start(t, weight))
+ if(!transport_start(t, weight, 0))
return t;
}
return NULL;
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);
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);
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);
/*
*
*
*/
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;