]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
mkv: don't add a new chapter if the previous one was added less than 10s ago
authorJohn Törnblom <john.tornblom@gmail.com>
Tue, 8 Jan 2013 17:02:04 +0000 (18:02 +0100)
committerJohn Törnblom <john.tornblom@gmail.com>
Tue, 8 Jan 2013 21:33:04 +0000 (22:33 +0100)
src/muxer/tvh/mkmux.c

index 9293b03d0d8de1cf1248efc4c8751a63b167f82f..22c23bdf9deb724cb73e4027898428b120d16367 100644 (file)
@@ -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));