Fixed chapter time creation bug
authorAlan J. Pippin <alan@pippins.net>
Fri, 18 Nov 2011 04:52:20 +0000 (21:52 -0700)
committerAlan J. Pippin <ajp@pippins.net>
Fri, 18 Nov 2011 04:52:20 +0000 (21:52 -0700)
make_mkv
merge_videos_by_day

index 4c411529b887953d9e7a33df97ebedb4343cce14..6ad22c6b186a50d86956652061fd9615dc0a0c76 100755 (executable)
--- 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";
index 52164d4689824615a25c3a206f81528c926e8347..b012c392bb40d090d0c9be872d0e28f140b4ce26 100755 (executable)
@@ -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) {