From: John Törnblom Date: Tue, 8 Jan 2013 17:02:04 +0000 (+0100) Subject: mkv: don't add a new chapter if the previous one was added less than 10s ago X-Git-Tag: v3.5~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=578c9fea796f6cc99dc217419ce84f3abf598786;p=thirdparty%2Ftvheadend.git mkv: don't add a new chapter if the previous one was added less than 10s ago --- diff --git a/src/muxer/tvh/mkmux.c b/src/muxer/tvh/mkmux.c index 9293b03d0..22c23bdf9 100644 --- a/src/muxer/tvh/mkmux.c +++ b/src/muxer/tvh/mkmux.c @@ -748,10 +748,17 @@ mk_add_chapter(mk_mux_t *mkm, int64_t ts) int uuid; ch = TAILQ_LAST(&mkm->chapters, mk_chapter_queue); - if(ch) + if(ch) { + // don't add a new chapter if the previous one was + // added less than 10s ago + if(ts - ch->ts < 10000) + return; + uuid = ch->uuid + 1; - else + } + else { uuid = 1; + } ch = malloc(sizeof(struct mk_chapter));