Skip to content

Commit f15f057

Browse files
lighterowlFlole998
authored andcommitted
Allow setting a custom grace period for LinuxDVB adapters
When using Astrometa to tune to DVB-T2 muxes in Poland, the scans are reported as complete but the found services have zero elementary services due to the scan period being too short in order to fetch PMTs. This change allows overriding the default grace period of 5 seconds with a custom value. I successfully scanned all services with this setting changed to 15 for this particular adapter/mux combination.
1 parent 552f941 commit f15f057

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/input/mpegts/linuxdvb/linuxdvb_frontend.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,18 @@ const idclass_t linuxdvb_frontend_class =
244244
.opts = PO_ADVANCED,
245245
.off = offsetof(linuxdvb_frontend_t, lfe_old_status),
246246
},
247+
{
248+
.type = PT_U32,
249+
.id = "grace_period",
250+
.name = N_("Scan grace period (seconds)"),
251+
.desc = N_("The maximum amount of time to allow this adapter "
252+
"to complete a scan of a mux. If you're getting "
253+
"failed or incomplete scans (for example, missing "
254+
"services) despite a strong signal, try increasing "
255+
"this value. Ignored for DVB-S."),
256+
.opts = PO_ADVANCED,
257+
.off = offsetof(linuxdvb_frontend_t, lfe_grace_period),
258+
},
247259
{}
248260
}
249261
};
@@ -593,10 +605,7 @@ static int
593605
linuxdvb_frontend_get_grace ( mpegts_input_t *mi, mpegts_mux_t *mm )
594606
{
595607
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)mi;
596-
int r = 5;
597-
if (lfe->lfe_satconf)
598-
r = linuxdvb_satconf_get_grace(lfe->lfe_satconf, mm);
599-
return r;
608+
return lfe->lfe_satconf ? linuxdvb_satconf_get_grace(lfe->lfe_satconf, mm) : lfe->lfe_grace_period;
600609
}
601610

602611
static int
@@ -2167,6 +2176,7 @@ linuxdvb_frontend_create
21672176
lfe->lfe_pids_use_all = 1;
21682177
lfe->lfe_sig_multiplier = 100;
21692178
lfe->lfe_snr_multiplier = 100;
2179+
lfe->lfe_grace_period = 5;
21702180
lfe = (linuxdvb_frontend_t*)mpegts_input_create0((mpegts_input_t*)lfe, idc, uuid, conf);
21712181
if (!lfe) return NULL;
21722182

src/input/mpegts/linuxdvb/linuxdvb_private.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ struct linuxdvb_frontend
150150
int lfe_lna;
151151
uint32_t lfe_sig_multiplier;
152152
uint32_t lfe_snr_multiplier;
153+
uint32_t lfe_grace_period;
153154

154155
/*
155156
* Satconf (DVB-S only)

0 commit comments

Comments
 (0)