mpegts: one more dvb-s fix, I'm now able to stream from DVB-S!

This commit is contained in:
Adam Sutton 2013-06-16 13:08:48 +01:00
parent 3ab4e5ae5b
commit fce73c118a
4 changed files with 23 additions and 7 deletions

View file

@ -397,6 +397,7 @@ struct mpegts_input
mpegts_network_t *(*mi_network_create) (mpegts_input_t *mi, htsmsg_t *c);
void (*mi_started_mux) (mpegts_input_t*,mpegts_mux_instance_t*);
void (*mi_stopped_mux) (mpegts_input_t*,mpegts_mux_instance_t*);
int (*mi_has_subscription) (mpegts_input_t*, mpegts_mux_t *mm);
};
#endif /* __TVH_MPEGTS_H__ */

View file

@ -280,6 +280,14 @@ linuxdvb_satconf_stopped_mux
ls->ls_frontend->mi_stopped_mux(ls->ls_frontend, mmi);
}
static int
linuxdvb_satconf_has_subscription
( mpegts_input_t *mi, mpegts_mux_t *mm )
{
linuxdvb_satconf_t *ls = (linuxdvb_satconf_t*)mi;
return ls->ls_frontend->mi_has_subscription(ls->ls_frontend, mm);
}
static int
linuxdvb_satconf_open_pid
( linuxdvb_frontend_t *lfe, int pid, const char *name )
@ -331,6 +339,7 @@ linuxdvb_satconf_create0
ls->mi_network_create = linuxdvb_satconf_network_create;
ls->mi_started_mux = linuxdvb_satconf_started_mux;
ls->mi_stopped_mux = linuxdvb_satconf_stopped_mux;
ls->mi_has_subscription = linuxdvb_satconf_has_subscription;
ls->lfe_open_pid = linuxdvb_satconf_open_pid;
/* Unoversal LMB */

View file

@ -204,6 +204,16 @@ mpegts_input_stopped_mux
}
}
static int
mpegts_input_has_subscription ( mpegts_input_t *mi, mpegts_mux_t *mm )
{
service_t *t;
LIST_FOREACH(t, &mi->mi_transports, s_active_link)
if (((mpegts_service_t*)t)->s_dvb_mux == mm)
return 1;
return 0;
}
/* **************************************************************************
* Data processing
* *************************************************************************/
@ -217,7 +227,6 @@ mpegts_input_recv_packets
int len = l;
int i = 0, table_wakeup = 0;
mpegts_mux_t *mm = mmi->mmi_mux;
//assert(mmi->mmi_input == mi);
assert(mm != NULL);
assert(name != NULL);
@ -394,6 +403,7 @@ mpegts_input_create0
mi->mi_create_mux_instance = mpegts_input_create_mux_instance;
mi->mi_started_mux = mpegts_input_started_mux;
mi->mi_stopped_mux = mpegts_input_stopped_mux;
mi->mi_has_subscription = mpegts_input_has_subscription;
/* Index */
mi->mi_instance = ++mpegts_input_idx;

View file

@ -331,13 +331,9 @@ mpegts_mux_close_table ( mpegts_mux_t *mm, mpegts_table_t *mt )
static int
mpegts_mux_has_subscribers ( mpegts_mux_t *mm )
{
service_t *t;
mpegts_mux_instance_t *mmi = mm->mm_active;
if (mmi) {
LIST_FOREACH(t, &mmi->mmi_input->mi_transports, s_active_link)
if (((mpegts_service_t*)t)->s_dvb_mux == mm)
return 1;
}
if (mmi)
return mmi->mmi_input->mi_has_subscription(mmi->mmi_input, mm);
return 0;
}