From 578c9fea796f6cc99dc217419ce84f3abf598786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20T=C3=B6rnblom?= Date: Tue, 8 Jan 2013 18:02:04 +0100 Subject: [PATCH] mkv: don't add a new chapter if the previous one was added less than 10s ago --- src/muxer/tvh/mkmux.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/muxer/tvh/mkmux.c b/src/muxer/tvh/mkmux.c index 9293b03d..22c23bdf 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));