Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
linuxdvb: allow to modify the input buffer size
  • Loading branch information
perexg committed Jan 17, 2015
1 parent 4df20c2 commit f157e18
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/html/config_tvadapters.html
Expand Up @@ -72,6 +72,10 @@ <h3>The adapters and tuners are listed / edited in a tree</h3>
<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>
Expand Down
10 changes: 9 additions & 1 deletion src/input/mpegts/linuxdvb/linuxdvb_frontend.c
Expand Up @@ -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),
},
{}
}
};
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions src/input/mpegts/linuxdvb/linuxdvb_private.h
Expand Up @@ -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)
Expand Down

0 comments on commit f157e18

Please sign in to comment.