Skip to content

Commit 61b4914

Browse files
committed
fix for #36 23.976 DF codes
1 parent c901a7e commit 61b4914

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ To run the tests in a browser environment, open the `test/smpte-timecode-test.ht
100100
in a browser.
101101

102102
## Update History
103+
- 1.3.3
104+
- fix for #36 - 23.976 is never a drop frame timecode.
103105
- 1.3.2
104106
- fixed to browser-based tests, documentation.
105107
- 1.3.1

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "smpte-timecode",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"description": "JavaScript implementation of SMPTE timecode type",
55
"main": "smpte-timecode.js",
66
"scripts": {

smpte-timecode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
// we got a fractional, we'll assume it's a 29.97, 23.98, 59.94 or something of the sort
4747
this.frameRateNum = frameRateRound*1000;
4848
this.frameRateDen = 1001;
49-
this.dropFrame = true;
49+
if (frameRateRound != 24) this.dropFrame = true;
5050
}
5151
}
5252
break;
@@ -69,7 +69,7 @@
6969
this.seconds = parseInt(parts[3]);
7070
// do not override input parameters
7171
if (typeof dropFrame !== 'boolean') {
72-
this.dropFrame = parts[4]!==':';
72+
this.dropFrame = ( parts[4]!==':' && this.frameRate>25 );
7373
}
7474
this.frames = parseInt(parts[5]);
7575
this._timeCodeToFrameCount();

test/smpte-timecode-test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,12 @@ describe('DST handling', function() {
276276
});
277277

278278
});
279+
280+
describe('Issues', function() {
281+
it ('#36 23.976 Time Code', function(){
282+
var t = new Timecode("10:00:00;06", 23.976, false);
283+
expect(t.dropFrame).to.be(false);
284+
var t1 = new Timecode("10:00:00;06", 23.976);
285+
expect(t1.dropFrame).to.be(false);
286+
});
287+
});

0 commit comments

Comments
 (0)