Subject: | Time::Timecode substraction problem |
Date: | Wed, 4 Dec 2013 13:54:44 -0500 |
To: | bug-Time-Timecode [...] rt.cpan.org |
From: | Javier Szyszlican <javier [...] szysz.com> |
Hi,
I'm running Time::Timecode version 0.2 on Perl v5.14.2
Most of the calculations seems to be fine, but I found this problem and I
don't know why its not working.
Here's the sample code:
use Data::Dumper;
use Time::Timecode;
my $a = Time::Timecode->new(23,0,4,29, {dropframe => 1});
my $b = Time::Timecode->new(0,0,5,0, {dropframe => 1});
print Dumper ($a);
print Dumper ($b);
my $c = $a - $b;
print Dumper ($c);
And this is the output:
$VAR1 = bless( {
'_delimiter' => ':',
'_minutes' => 0,
'_rounded_fps' => '30',
'_is_dropframe' => 1,
'_hours' => 23,
'_frames' => 29,
'_total_frames' => 2481665,
'_fps' => 30,
'_seconds' => 4,
'_frame_delimiter' => ':'
}, 'Time::Timecode' );
$VAR1 = bless( {
'_delimiter' => ':',
'_minutes' => 0,
'_rounded_fps' => '30',
'_is_dropframe' => 1,
'_hours' => 0,
'_frames' => 0,
'_total_frames' => 150,
'_fps' => 30,
'_seconds' => 5,
'_frame_delimiter' => ':'
}, 'Time::Timecode' );
*Invalid minutes '60': minutes must be between 0 and 59 at test.pl
<http://test.pl>*
I'm subtracting 5 seconds from the 23:00:04;29 timecode. I was expecting
22:59:59:29 as a result.
It seems to be a problem calculating the TC from the resulting number of
frames after the subtraction.
Javier