Skip to content

Commit

Permalink
ELST: Truncate floating numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
gkozlenko committed Apr 21, 2024
1 parent b6ca72d commit bb20ad3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/mp4/builder-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class BuilderImpl {
elstAtom.entries = [track.duration * this.movie.timescale / track.timescale, 0, 1 << 16];
if (track.samples.length > 0 && track.samples[0].timestamp > 0) {
// add an empty edit
let duration = track.samples[0].timestamp * this.movie.timescale / track.timescale;
let duration = (track.samples[0].timestamp * this.movie.timescale / track.timescale) >>> 0;
elstAtom.entries.unshift(duration, -1, 1 << 16);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/mp4/parser-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class ParserImpl {
let editEntries = ParserImpl._getEntries(edtsAtom, Utils.ATOM_ELST);
if (editEntries.length >= 3 && editEntries[1] === -1) {
// apply the first empty edit
currentTimestamp = editEntries[0] * track.timescale / this.movie.timescale;
currentTimestamp = (editEntries[0] * track.timescale / this.movie.timescale) >>> 0;
}
}

Expand Down

0 comments on commit bb20ad3

Please sign in to comment.