Skip to content

Commit

Permalink
fixed 59.94 ndf timecodes
Browse files Browse the repository at this point in the history
  • Loading branch information
m1tk4 committed Jun 15, 2024
1 parent 617c92e commit 254c147
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ To run the tests in a browser environment, open the `test/smpte-timecode-test.ht
in a browser.

## Update History
- 1.3.6
- fix for #42 - 59.94 and 29.97 non-drop-frame timecodes would not initialize properly
- 1.3.5
- packaging fix
- 1.3.4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smpte-timecode",
"version": "1.3.5",
"version": "1.3.6",
"description": "JavaScript implementation of SMPTE timecode type",
"main": "smpte-timecode.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion smpte-timecode.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
// we got a fractional, we'll assume it's a 29.97, 23.98, 59.94 or something of the sort
this.frameRateNum = frameRateRound*1000;
this.frameRateDen = 1001;
if (frameRateRound != 24) this.dropFrame = true;
if (frameRateRound != 24 && typeof(dropFrame) !== 'boolean') this.dropFrame = true;
}
}
break;
Expand Down
6 changes: 6 additions & 0 deletions test/smpte-timecode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,10 @@ describe('Issues', function() {
expect(t.frameCount).to.be(2112);
expect(Timecode('12:34:56:578',600).toString()).to.be('12:34:56:578');
});

it ('#42 59.94 NDF Time Codes', function(){
var t = new Timecode(123456, 59.95, false);
expect(t.dropFrame).to.be(false);
});

});

0 comments on commit 254c147

Please sign in to comment.