Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Time-Timecode CPAN distribution.

Report information
The Basics
Id: 91181
Status: resolved
Priority: 0/
Queue: Time-Timecode

People
Owner: Nobody in particular
Requestors: javier [...] szysz.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



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
On Wed Dec 04 13:54:58 2013, javier@szysz.com wrote: Show quoted text
> > 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.
Yes, there is a problem with how I've implemented the additional "2 frames every minute except on the 10th minute" rule; I've overcompensated somewhere. Any thoughts about where I went wrong? I tried to fix it sometime ago but, but never nailed down the fix. This is something I definitely want to fix, but haven't had (or taken) the time. I have another release with some additional features that's collecting dust because of this: https://github.com/sshaw/Time-Timecode
This is (finally) fixed in v0.30, which has been published to CPAN. v0.30 contains various enhancements and also includes a timecode conversion executable: * timecode conversion executable: https://github.com/sshaw/Time-Timecode#timecode-conversion-utility-program * Changes: https://github.com/sshaw/Time-Timecode/blob/6f9b216572969d8668423a0379f36ead7d9d44b0/Changes