Comparing version 5.7.0 to 5.8.0
@@ -90,2 +90,4 @@ /** | ||
Math.floor(clock.videoTsToAudioTs(audioFillDuration, track.samplerate)); | ||
return audioFillDuration; | ||
}; | ||
@@ -92,0 +94,0 @@ |
@@ -52,3 +52,3 @@ /** | ||
var generateVideoSegmentTimingInfo = function( | ||
var generateSegmentTimingInfo = function( | ||
baseMediaDecodeTime, | ||
@@ -136,3 +136,5 @@ startDts, | ||
boxes, | ||
frameDuration; | ||
frameDuration, | ||
segmentDuration, | ||
videoClockCyclesOfSilencePrefixed; | ||
@@ -150,3 +152,4 @@ // return early if no audio data has been observed | ||
audioFrameUtils.prefixWithSilence( | ||
// amount of audio filled but the value is in video clock rather than audio clock | ||
videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence( | ||
track, frames, audioAppendStartTs, videoBaseMediaDecodeTime); | ||
@@ -181,5 +184,23 @@ | ||
if (frames.length) { | ||
segmentDuration = frames.length * frameDuration; | ||
this.trigger( | ||
'segmentTimingInfo', | ||
generateSegmentTimingInfo( | ||
// The audio track's baseMediaDecodeTime is in audio clock cycles, but the | ||
// frame info is in video clock cycles. Convert to match expectation of | ||
// listeners (that all timestamps will be based on video clock cycles). | ||
clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate), | ||
// frame times are already in video clock, as is segment duration | ||
frames[0].dts, | ||
frames[0].pts, | ||
frames[0].dts + segmentDuration, | ||
frames[0].pts + segmentDuration, | ||
videoClockCyclesOfSilencePrefixed || 0 | ||
) | ||
); | ||
this.trigger('timingInfo', { | ||
start: frames[0].pts, | ||
end: frames[0].pts + (frames.length * frameDuration) | ||
end: frames[0].pts + segmentDuration | ||
}); | ||
@@ -399,3 +420,3 @@ } | ||
'segmentTimingInfo', | ||
generateVideoSegmentTimingInfo( | ||
generateSegmentTimingInfo( | ||
track.baseMediaDecodeTime, | ||
@@ -1059,2 +1080,4 @@ firstGop.dts, | ||
self.trigger.bind(self, 'audioTimingInfo')); | ||
pipeline.audioSegmentStream.on('segmentTimingInfo', | ||
self.trigger.bind(self, 'audioSegmentTimingInfo')); | ||
@@ -1189,3 +1212,3 @@ // Set up the final part of the audio pipeline | ||
// exported for testing | ||
generateVideoSegmentTimingInfo: generateVideoSegmentTimingInfo | ||
generateSegmentTimingInfo: generateSegmentTimingInfo | ||
}; |
{ | ||
"name": "mux.js", | ||
"version": "5.7.0", | ||
"version": "5.8.0", | ||
"description": "A collection of lightweight utilities for inspecting and manipulating video container formats.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1324583
31677