Skip to content

Commit 96a8c03

Browse files
committed
* **Fix:** Fixed Timecode.float property for drop frames.
1 parent 9486700 commit 96a8c03

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Changes
1010
possible to have a Timecode with negative or zero frames as this is changed
1111
in 1.2.3.
1212

13+
* **Fix:** Fixed ``Timecode.float`` property for drop frames.
14+
1315
1.2.4
1416
=====
1517

tests/test_timecode.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,7 @@ def test_bug_report_30(self):
11201120

11211121
def test_bug_report_31_part1(self):
11221122
"""testing bug report 31
1123+
https://github.com/eoyilmaz/timecode/issues/31
11231124
"""
11241125
timecode1 = '01:00:10:00'
11251126
timecode2 = '01:00:10:00'
@@ -1138,6 +1139,7 @@ def test_bug_report_31_part1(self):
11381139

11391140
def test_bug_report_31_part2(self):
11401141
"""testing bug report 31
1142+
https://github.com/eoyilmaz/timecode/issues/31
11411143
"""
11421144
timecode1 = '01:00:08:00'
11431145
timecode2 = '01:00:10:00'
@@ -1146,3 +1148,12 @@ def test_bug_report_31_part2(self):
11461148
b = Timecode('25', timecode2)
11471149
offset = a - b
11481150
c = Timecode('25', timecode3) + offset
1151+
1152+
def test_bug_report_32(self):
1153+
"""testing bug report 32
1154+
https://github.com/eoyilmaz/timecode/issues/32
1155+
"""
1156+
framerate = "30000/1001"
1157+
seconds = 500
1158+
tc1 = Timecode(framerate, start_seconds=seconds)
1159+
self.assertEqual(seconds, tc1.float)

timecode/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def frame_number(self):
556556
def float(self):
557557
"""returns the seconds as float
558558
"""
559-
return float(self._frames) / float(self.framerate)
559+
return float(self._frames) / float(self._int_framerate)
560560

561561

562562
class TimecodeError(Exception):

0 commit comments

Comments
 (0)