linuxdvb: allow to modify the input buffer size

This commit is contained in:
Jaroslav Kysela 2015-01-17 19:02:38 +01:00
parent 4df20c2b6a
commit f157e1818d
3 changed files with 14 additions and 1 deletions

View file

@ -72,6 +72,10 @@ The rows have the following functions
<dd>If set, first bytes from the MPEG-TS stream are discarded. It may be
required for some drivers / hardware which does not flush completely
the MPEG-TS buffers after a frequency/parameters change.</dd>
<p>
<dt><b>Input Buffer (Bytes)</b></dt>
<dd>By default, linuxdvb input buffer is 18800 bytes long. The accepted
range is 18800-1880000 bytes.</dd>
</dl>
<p>

View file

@ -106,6 +106,13 @@ const idclass_t linuxdvb_frontend_class =
.opts = PO_ADVANCED,
.off = offsetof(linuxdvb_frontend_t, lfe_skip_bytes),
},
{
.type = PT_U32,
.id = "ibuf_size",
.name = "Input Buffer (Bytes)",
.opts = PO_ADVANCED,
.off = offsetof(linuxdvb_frontend_t, lfe_ibuf_size),
},
{}
}
};
@ -886,7 +893,7 @@ linuxdvb_frontend_input_thread ( void *aux )
tvhpoll_add(efd, ev, 2);
/* Allocate memory */
sbuf_init_fixed(&sb, 18800);
sbuf_init_fixed(&sb, MIN(MAX(18800, lfe->lfe_ibuf_size), 1880000));
/* Read */
while (tvheadend_running) {
@ -1433,6 +1440,7 @@ linuxdvb_frontend_create
lfe->lfe_type = type;
strncpy(lfe->lfe_name, name, sizeof(lfe->lfe_name));
lfe->lfe_name[sizeof(lfe->lfe_name)-1] = '\0';
lfe->lfe_ibuf_size = 18800;
lfe = (linuxdvb_frontend_t*)mpegts_input_create0((mpegts_input_t*)lfe, idc, uuid, conf);
if (!lfe) return NULL;

View file

@ -116,6 +116,7 @@ struct linuxdvb_frontend
int lfe_powersave;
int lfe_tune_repeats;
uint32_t lfe_skip_bytes;
uint32_t lfe_ibuf_size;
/*
* Satconf (DVB-S only)