Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
parser: make backlog function configurable
  • Loading branch information
perexg committed Feb 3, 2016
1 parent 12be36f commit c8810d2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
16 changes: 12 additions & 4 deletions src/config.c
Expand Up @@ -2057,15 +2057,23 @@ const idclass_t config_class = {
.type = PT_U32,
.id = "descrambler_buffer",
.name = N_("Descrambler buffer (TS packets)"),
.desc = N_("The number of packets Tvheadend buffers in case "
.desc = N_("The number of MPEG-TS packets Tvheadend buffers in case "
"there is a delay receiving CA keys. "),
/* Note: I'm not sure I've explained this very well
* ;)
*/
.off = offsetof(config_t, descrambler_buffer),
.opts = PO_EXPERT,
.group = 1
},
{
.type = PT_BOOL,
.id = "parser_backlog",
.name = N_("Use packet backlog"),
.desc = N_("Send previous stream frames to upper layers "
"(before frame start is signalled in the stream). "
"It may cause issues with some clients / players."),
.off = offsetof(config_t, parser_backlog),
.opts = PO_EXPERT,
.group = 1
},
{
.type = PT_STR,
.islist = 1,
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Expand Up @@ -51,6 +51,7 @@ typedef struct config {
uint32_t cookie_expires;
int dscp;
uint32_t descrambler_buffer;
int parser_backlog;
} config_t;

extern const idclass_t config_class;
Expand Down
4 changes: 3 additions & 1 deletion src/parsers/parsers.c
Expand Up @@ -36,6 +36,7 @@
#include "bitstream.h"
#include "packet.h"
#include "streaming.h"
#include "config.h"

/* parser states */
#define PARSER_APPEND 0
Expand Down Expand Up @@ -1341,7 +1342,8 @@ parse_h264_deliver(service_t *t, elementary_stream_t *st, th_pkt_t *pkt)
goto deliver;
}
}
parser_backlog(t, st, pkt);
if (config.parser_backlog)
parser_backlog(t, st, pkt);
}

static int
Expand Down

0 comments on commit c8810d2

Please sign in to comment.