>From 9fe998c760df067f1cf07ba2641a0064761506fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20G=C3=BCntner?= <fatbull@web.de>
Date: Wed, 28 Sep 2011 15:40:42 +0000
Subject: [PATCH 1/2] Do not create chapters for regions which have been cut.

---
 modules/access/vdr.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/modules/access/vdr.c b/modules/access/vdr.c
index 873d93f..b0cf722 100644
--- a/modules/access/vdr.c
+++ b/modules/access/vdr.c
@@ -846,10 +846,18 @@ static void ImportMarks( access_t *p_access )
         var_InheritInteger( p_access, "vdr-chapter-offset" );
 
     /* parse lines of the form "0:00:00.00 foobar" */
+    int i_line_count = 0;
     char *line = NULL;
     size_t line_len;
     while( ReadLine( &line, &line_len, marksfile ) )
     {
+        /* Cut marks come in pairs. The first mark is at the beginning
+         * of a region we have to keep, so we start a chapter here. The
+         * second mark ends this region. Everything from there up to
+         * the next mark is supposed to be cut, so we ignore it. */
+        if( i_line_count++ % 2 )
+            continue;
+
         int64_t i_frame = ParseFrameNumber( line, p_sys->fps );
 
         /* move chapters (simple workaround for inaccurate cut marks) */
-- 
1.7.0.4

