Skip to content

Commit

Permalink
fix: empty audio track (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyuhen authored Apr 1, 2019
1 parent 67d37bb commit a62ef4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/griffith-mp4/src/mp4/mp4Probe.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default class MP4Probe {
videoSamples[videoSamples.length - 1].start +
videoSamples[videoSamples.length - 1].bufferStart ===
stcoBox.samples[stcoBox.samples.length - 1].chunkOffset

return getFragmentPosition(
videoSamples,
audioSamples,
Expand Down
5 changes: 3 additions & 2 deletions packages/griffith-mp4/src/mp4/utils/getSamplesInterval.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export function getVideoSamplesInterval(mp4BoxTree, time = 0) {
const timeInterval = intervalArray.map(interval =>
getDuration(sttsBox, interval)
)

const interval = {
offsetInterVal: [],
timeInterVal: [],
Expand Down Expand Up @@ -52,8 +53,8 @@ export function getAudioSamplesInterval(mp4BoxTree, videoInterval) {
let start = 0
let end = 0

const {mediaTime} = audioElstBox.entries[0]
let startDuration = mediaTime || 0
const {mediaTime, segmentDuration} = audioElstBox.entries[0]
let startDuration = mediaTime !== -1 ? mediaTime : segmentDuration
let endDuration = 0
for (let i = 0; i < sttsBox.samples.length; i++) {
const {sampleCount, sampleDelta} = sttsBox.samples[i]
Expand Down
1 change: 0 additions & 1 deletion packages/griffith-mp4/src/mse/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export default class MSE {

seek = time => {
FragmentFetch.clear()

const [start, end] = this.mp4Probe.getFragmentPosition(time)
this.mseUpdating = true

Expand Down

0 comments on commit a62ef4d

Please sign in to comment.