Skip to content

Commit

Permalink
fix new type of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
jobispo committed Jan 18, 2024
1 parent 991915f commit 0ca7709
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 132 deletions.
108 changes: 54 additions & 54 deletions dist/shaka-player.compiled.debug.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/shaka-player.compiled.debug.map

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions dist/shaka-player.compiled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/shaka-player.compiled.map

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions dist/shaka-player.ui.debug.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/shaka-player.ui.debug.map

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions dist/shaka-player.ui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/shaka-player.ui.map

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,12 @@ shaka.media.StreamingEngine = class {
box.reader, box.version);

const baseMediaDecodeTime = parsedTFDT.baseMediaDecodeTime;

// In case the time is 0, it is not updated
if (!baseMediaDecodeTime) {
return;
}

const scaledMediaDecodeTime = baseMediaDecodeTime / timescale;

if (Math.abs(mediaState.lastTimestampOffset) >
Expand Down Expand Up @@ -1513,6 +1519,7 @@ shaka.media.StreamingEngine = class {
logPrefix + ' segment should start before append window end');

const timestampOffset = reference.timestampOffset;
let timescale;
if (timestampOffset != mediaState.lastTimestampOffset ||
appendWindowStart != mediaState.lastAppendWindowStart ||
appendWindowEnd != mediaState.lastAppendWindowEnd) {
Expand All @@ -1522,6 +1529,7 @@ shaka.media.StreamingEngine = class {
shaka.log.v1(logPrefix,
'setting append window end to ' + appendWindowEnd);

timescale = null;
const setProperties = async () => {
try {
mediaState.lastAppendWindowStart = appendWindowStart;
Expand All @@ -1542,8 +1550,6 @@ shaka.media.StreamingEngine = class {
operations.push(setProperties());
}

let timescale;

if (!shaka.media.InitSegmentReference.equal(
reference.initSegmentReference, mediaState.lastInitSegmentReference)) {
mediaState.lastInitSegmentReference = reference.initSegmentReference;
Expand All @@ -1552,6 +1558,12 @@ shaka.media.StreamingEngine = class {
shaka.log.v1(logPrefix, 'fetching init segment');

const setTimeScale = (data) => {
// if timescale has not been set to null
// means it did not enter in the previous
// if
if (timescale !== null) {
return;
}
new shaka.util.Mp4Parser()
.box('moov', shaka.util.Mp4Parser.children)
.box('mvhd', (box) => {
Expand Down

0 comments on commit 0ca7709

Please sign in to comment.