mpegts: add PMT monitoring option
PMT monitoring is currently disabled by default, need to decide whether this is the correct behaviour. This should help low performance tuners. Fixes #1986
This commit is contained in:
parent
34ab2929d2
commit
c361cc6c69
3 changed files with 33 additions and 2 deletions
|
@ -405,6 +405,12 @@ struct mpegts_service
|
|||
*/
|
||||
int64_t s_pcr_drift;
|
||||
|
||||
/**
|
||||
* PMT monitoring
|
||||
*/
|
||||
|
||||
mpegts_table_t *s_pmt_mon; ///< Table entry for monitoring PMT
|
||||
|
||||
};
|
||||
|
||||
/* **************************************************************************
|
||||
|
@ -454,6 +460,8 @@ struct mpegts_input
|
|||
|
||||
int mi_priority;
|
||||
|
||||
int mi_pmtmon;
|
||||
|
||||
LIST_ENTRY(mpegts_input) mi_global_link;
|
||||
|
||||
mpegts_network_link_list_t mi_networks;
|
||||
|
|
|
@ -591,8 +591,12 @@ dvb_pat_callback
|
|||
tvhdebug("pat", " sid %04X (%d) on pid %04X (%d)", sid, sid, pid, pid);
|
||||
int save = 0;
|
||||
if ((s = mpegts_service_find(mm, sid, pid, 1, &save))) {
|
||||
mpegts_table_add(mm, DVB_PMT_BASE, DVB_PMT_MASK, dvb_pmt_callback,
|
||||
NULL, "pmt", MT_CRC | MT_QUICKREQ, pid);
|
||||
if (mm->mm_active && mm->mm_active->mmi_input) {
|
||||
mpegts_input_t *mi = mm->mm_active->mmi_input;
|
||||
if (mi->mi_pmtmon)
|
||||
mpegts_table_add(mm, DVB_PMT_BASE, DVB_PMT_MASK, dvb_pmt_callback,
|
||||
NULL, "pmt", MT_CRC | MT_QUICKREQ, pid);
|
||||
}
|
||||
|
||||
if (save)
|
||||
service_request_save((service_t*)s, 1);
|
||||
|
|
|
@ -153,6 +153,13 @@ const idclass_t mpegts_input_class =
|
|||
.list = mpegts_input_class_network_enum,
|
||||
.rend = mpegts_input_class_network_rend,
|
||||
},
|
||||
{
|
||||
.type = PT_BOOL,
|
||||
.id = "pmtmon",
|
||||
.name = "Enable PMT monitor",
|
||||
.off = offsetof(mpegts_input_t, mi_pmtmon),
|
||||
.opts = PO_ADVANCED,
|
||||
},
|
||||
{}
|
||||
}
|
||||
};
|
||||
|
@ -319,6 +326,12 @@ mpegts_input_open_service ( mpegts_input_t *mi, mpegts_service_t *s, int init )
|
|||
|
||||
pthread_mutex_unlock(&s->s_stream_mutex);
|
||||
pthread_mutex_unlock(&mi->mi_output_lock);
|
||||
|
||||
/* Add PMT monitor */
|
||||
s->s_pmt_mon =
|
||||
mpegts_table_add(s->s_dvb_mux, DVB_PMT_BASE, DVB_PMT_MASK,
|
||||
dvb_pmt_callback, s, "pmt",
|
||||
MT_CRC, s->s_pmt_pid);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -326,6 +339,11 @@ mpegts_input_close_service ( mpegts_input_t *mi, mpegts_service_t *s )
|
|||
{
|
||||
elementary_stream_t *st;
|
||||
|
||||
/* Close PMT table */
|
||||
if (s->s_pmt_mon)
|
||||
mpegts_table_destroy(s->s_pmt_mon);
|
||||
s->s_pmt_mon = NULL;
|
||||
|
||||
/* Remove from list */
|
||||
pthread_mutex_lock(&mi->mi_output_lock);
|
||||
if (s->s_dvb_active_input != NULL) {
|
||||
|
@ -340,6 +358,7 @@ mpegts_input_close_service ( mpegts_input_t *mi, mpegts_service_t *s )
|
|||
TAILQ_FOREACH(st, &s->s_components, es_link)
|
||||
mi->mi_close_pid(mi, s->s_dvb_mux, st->es_pid, MPS_STREAM, s);
|
||||
|
||||
|
||||
pthread_mutex_unlock(&s->s_stream_mutex);
|
||||
pthread_mutex_unlock(&mi->mi_output_lock);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue