Skip to content

Commit

Permalink
* **Fix:** Fixed Timecode.float property for drop frames.
Browse files Browse the repository at this point in the history
  • Loading branch information
eoyilmaz committed Nov 2, 2020
1 parent 9486700 commit 96a8c03
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Changes
possible to have a Timecode with negative or zero frames as this is changed
in 1.2.3.

* **Fix:** Fixed ``Timecode.float`` property for drop frames.

1.2.4
=====

Expand Down
11 changes: 11 additions & 0 deletions tests/test_timecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,7 @@ def test_bug_report_30(self):

def test_bug_report_31_part1(self):
"""testing bug report 31
https://github.com/eoyilmaz/timecode/issues/31
"""
timecode1 = '01:00:10:00'
timecode2 = '01:00:10:00'
Expand All @@ -1138,6 +1139,7 @@ def test_bug_report_31_part1(self):

def test_bug_report_31_part2(self):
"""testing bug report 31
https://github.com/eoyilmaz/timecode/issues/31
"""
timecode1 = '01:00:08:00'
timecode2 = '01:00:10:00'
Expand All @@ -1146,3 +1148,12 @@ def test_bug_report_31_part2(self):
b = Timecode('25', timecode2)
offset = a - b
c = Timecode('25', timecode3) + offset

def test_bug_report_32(self):
"""testing bug report 32
https://github.com/eoyilmaz/timecode/issues/32
"""
framerate = "30000/1001"
seconds = 500
tc1 = Timecode(framerate, start_seconds=seconds)
self.assertEqual(seconds, tc1.float)
2 changes: 1 addition & 1 deletion timecode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def frame_number(self):
def float(self):
"""returns the seconds as float
"""
return float(self._frames) / float(self.framerate)
return float(self._frames) / float(self._int_framerate)


class TimecodeError(Exception):
Expand Down

0 comments on commit 96a8c03

Please sign in to comment.