From 5483963151e96a4941fac5721f76d2f3119a851a Mon Sep 17 00:00:00 2001
From: "Alan J. Pippin" <alan@pippins.net>
Date: Thu, 17 Nov 2011 21:52:20 -0700
Subject: [PATCH] Fixed chapter time creation bug

---
 make_mkv            | 4 +---
 merge_videos_by_day | 1 +
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/make_mkv b/make_mkv
index 4c41152..6ad22c6 100755
--- a/make_mkv
+++ b/make_mkv
@@ -96,9 +96,7 @@ foreach my $video (sort{$videos{$a} <=> $videos{$b}} keys %videos) {
     print CHAPTERS "CHAPTER".sprintf("%02d",$chapter_num)."=".$start_time."\n";
     print CHAPTERS "CHAPTER".sprintf("%02d",$chapter_num)."NAME=".$mdate."\n";
     my $dt = DateTime::Duration->new(years => 1900, hours => $hour, minutes => $min, seconds => $sec);
-    my $prev_dt = DateTime::Duration->new(years => 1900, hours => $prev_hour, minutes => $prev_min, seconds => $prev_sec);
-    $new_duration = $dt + $prev_dt;
-    $prev_hour = $hour; $prev_min = $min; $prev_sec = $sec;
+    $new_duration = $dt + $new_duration;
 }
 close(CHAPTERS);
 print "\n-> Creating the following chapter file for this video:\n";
diff --git a/merge_videos_by_day b/merge_videos_by_day
index 52164d4..b012c39 100755
--- a/merge_videos_by_day
+++ b/merge_videos_by_day
@@ -141,6 +141,7 @@ foreach $video (sort keys %videos) {
 	print "   merging \"$srcfile\" into \"$video\"\n";
     }
 }
+print "\n";
 
 # Now actually do the merging
 foreach $video (sort keys %videos) {
-- 
2.34.1