mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
chore: Reduce same conditions in StreamingEngine (#8709)
This commit is contained in:
committed by
GitHub
parent
e8a8ad9fab
commit
b752f779cf
@@ -2468,8 +2468,6 @@ shaka.media.StreamingEngine = class {
|
||||
stream.closedCaptions.size > 0;
|
||||
|
||||
if (this.config_.shouldFixTimestampOffset) {
|
||||
let parser;
|
||||
|
||||
const isMP4 = stream.mimeType == 'video/mp4' ||
|
||||
stream.mimeType == 'audio/mp4';
|
||||
let timescale = null;
|
||||
@@ -2481,11 +2479,7 @@ shaka.media.StreamingEngine = class {
|
||||
this.manifest_.type == shaka.media.ManifestParser.DASH;
|
||||
|
||||
if (shouldFixTimestampOffset) {
|
||||
parser = new shaka.util.Mp4Parser();
|
||||
}
|
||||
|
||||
if (shouldFixTimestampOffset) {
|
||||
parser
|
||||
new shaka.util.Mp4Parser()
|
||||
.box('moof', shaka.util.Mp4Parser.children)
|
||||
.box('traf', shaka.util.Mp4Parser.children)
|
||||
.fullBox('tfdt', async (box) => {
|
||||
@@ -2519,11 +2513,8 @@ shaka.media.StreamingEngine = class {
|
||||
await this.setProperties_(mediaState, scaledMediaDecodeTime,
|
||||
lastAppendWindowStart, lastAppendWindowEnd, reference);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (shouldFixTimestampOffset) {
|
||||
parser.parse(segment, /* partialOkay= */ false, isChunkedData);
|
||||
})
|
||||
.parse(segment, /* partialOkay= */ false, isChunkedData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user