Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix moov duration fields #3309

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/mss/MssFragmentMoovProcessor.js
Expand Up @@ -154,7 +154,7 @@ function MssFragmentMoovProcessor(config) {
mvhd.creation_time = 0; // the creation time of the presentation => ignore (set to 0)
mvhd.modification_time = 0; // the most recent time the presentation was modified => ignore (set to 0)
mvhd.timescale = timescale; // the time-scale for the entire presentation => 10000000 for MSS
mvhd.duration = Math.round(period.duration * timescale); // the length of the presentation (in the indicated timescale) => take duration of period
mvhd.duration = period.duration === Infinity ? 0xFFFFFFFFFFFFFFFF : Math.round(period.duration * timescale); // the length of the presentation (in the indicated timescale) => take duration of period
mvhd.rate = 1.0; // 16.16 number, '1.0' = normal playback
mvhd.volume = 1.0; // 8.8 number, '1.0' = full volume
mvhd.reserved1 = 0;
Expand Down Expand Up @@ -183,7 +183,7 @@ function MssFragmentMoovProcessor(config) {
tkhd.modification_time = 0; // the most recent time the presentation was modified => ignore (set to 0)
tkhd.track_ID = trackId; // uniquely identifies this track over the entire life-time of this presentation
tkhd.reserved1 = 0;
tkhd.duration = Math.round(period.duration * timescale); // the duration of this track (in the timescale indicated in the Movie Header Box) => take duration of period
tkhd.duration = period.duration === Infinity ? 0xFFFFFFFFFFFFFFFF : Math.round(period.duration * timescale); // the duration of this track (in the timescale indicated in the Movie Header Box) => take duration of period
tkhd.reserved2 = [0x0, 0x0];
tkhd.layer = 0; // specifies the front-to-back ordering of video tracks; tracks with lower numbers are closer to the viewer => 0 since only one video track
tkhd.alternate_group = 0; // specifies a group or collection of tracks => ignore
Expand All @@ -209,8 +209,8 @@ function MssFragmentMoovProcessor(config) {
mdhd.creation_time = 0; // the creation time of the presentation => ignore (set to 0)
mdhd.modification_time = 0; // the most recent time the presentation was modified => ignore (set to 0)
mdhd.timescale = timescale; // the time-scale for the entire presentation
mdhd.duration = Math.round(period.duration * timescale); // the duration of this media (in the scale of the timescale). If the duration cannot be determined then duration is set to all 1s.
mdhd.language = adaptationSet.lang || 'und'; // declares the language code for this media (see getLanguageCode())
mdhd.duration = period.duration === Infinity ? 0xFFFFFFFFFFFFFFFF : Math.round(period.duration * timescale); // the duration of this media (in the scale of the timescale). If the duration cannot be determined then duration is set to all 1s.
mdhd.language = adaptationSet.lang || 'und'; // declares the language code for this media
mdhd.pre_defined = 0;

return mdhd;
Expand Down