Comparing version
@@ -11,2 +11,3 @@ /** | ||
var toUnsigned = require('../utils/bin').toUnsigned; | ||
var findBox, parseType, timescale, startTime; | ||
@@ -25,6 +26,6 @@ | ||
for (i = 0; i < data.byteLength;) { | ||
size = data[i] << 24; | ||
size |= data[i + 1] << 16; | ||
size |= data[i + 2] << 8; | ||
size |= data[i + 3]; | ||
size = toUnsigned(data[i] << 24 | | ||
data[i + 1] << 16 | | ||
data[i + 2] << 8 | | ||
data[i + 3]); | ||
@@ -102,6 +103,6 @@ type = parseType(data.subarray(i + 4, i + 8)); | ||
index = version === 0 ? 12 : 20; | ||
id = tkhd[index] << 24 | | ||
tkhd[index + 1] << 16 | | ||
tkhd[index + 2] << 8 | | ||
tkhd[index + 3]; | ||
id = toUnsigned(tkhd[index] << 24 | | ||
tkhd[index + 1] << 16 | | ||
tkhd[index + 2] << 8 | | ||
tkhd[index + 3]); | ||
@@ -114,6 +115,6 @@ mdhd = findBox(trak, ['mdia', 'mdhd'])[0]; | ||
index = version === 0 ? 12 : 20; | ||
result[id] = mdhd[index] << 24 | | ||
mdhd[index + 1] << 16 | | ||
mdhd[index + 2] << 8 | | ||
mdhd[index + 3]; | ||
result[id] = toUnsigned(mdhd[index] << 24 | | ||
mdhd[index + 1] << 16 | | ||
mdhd[index + 2] << 8 | | ||
mdhd[index + 3]); | ||
return result; | ||
@@ -151,6 +152,6 @@ }, result); | ||
// get the track id from the tfhd | ||
id = tfhd[4] << 24 | | ||
tfhd[5] << 16 | | ||
tfhd[6] << 8 | | ||
tfhd[7]; | ||
id = toUnsigned(tfhd[4] << 24 | | ||
tfhd[5] << 16 | | ||
tfhd[6] << 8 | | ||
tfhd[7]); | ||
// assume a 90kHz clock if no timescale was specified | ||
@@ -164,12 +165,12 @@ scale = timescale[id] || 90e3; | ||
version = tfdt[0]; | ||
result = tfdt[4] << 24 | | ||
tfdt[5] << 16 | | ||
tfdt[6] << 8 | | ||
tfdt[7]; | ||
result = toUnsigned(tfdt[4] << 24 | | ||
tfdt[5] << 16 | | ||
tfdt[6] << 8 | | ||
tfdt[7]); | ||
if (version === 1) { | ||
result *= Math.pow(2, 32); | ||
result += tfdt[8] << 24 | | ||
tfdt[9] << 16 | | ||
tfdt[10] << 8 | | ||
tfdt[11]; | ||
result += toUnsigned(tfdt[8] << 24 | | ||
tfdt[9] << 16 | | ||
tfdt[10] << 8 | | ||
tfdt[11]); | ||
} | ||
@@ -176,0 +177,0 @@ return result; |
{ | ||
"name": "mux.js", | ||
"version": "4.4.0", | ||
"version": "4.4.1", | ||
"description": "A collection of lightweight utilities for inspecting and manipulating video container formats.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -1,2 +0,2 @@ | ||
# mux.js [](https://travis-ci.org/videojs/mux.js) | ||
# mux.js [](https://travis-ci.org/videojs/mux.js) [](https://greenkeeper.io/) | ||
@@ -3,0 +3,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
22431
0.07%930027
-0.54%