>From 0651bc348e40021eec52ca901dc6faed7b4d3fc4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20G=C3=BCntner?= <fatbull@web.de>
Date: Mon, 26 Sep 2011 14:54:16 +0000
Subject: [PATCH] Do not create chapters for regions which have been cut.

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

diff --git a/modules/access/vdr.c b/modules/access/vdr.c
index 873d93f..58c45b1 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) */
@@ -880,21 +888,9 @@ static void ImportMarks( access_t *p_access )
     }
 
     if( p_marks->i_seekpoint > 0 )
-    {
-        seekpoint_t *sp = vlc_seekpoint_New();
-        if( sp )
-        {
-            sp->i_byte_offset = 0;
-            sp->i_time_offset = 0;
-            sp->psz_name = strdup( _("Start") );
-            TAB_INSERT( p_marks->i_seekpoint, p_marks->seekpoint, sp, 0 );
-        }
         p_sys->p_marks = p_marks;
-    }
     else
-    {
         vlc_input_title_Delete( p_marks );
-    }
 
     fclose( marksfile );
     fclose( indexfile );
-- 
1.7.0.4

