Skip to content

Commit

Permalink
fragment-tracker: fix exception when dealing with fmp4 initsegment fr…
Browse files Browse the repository at this point in the history
…agment

related to video-dev#1510
  • Loading branch information
mangui committed Jan 21, 2018
1 parent 84fe6a7 commit ad3b10d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/helper/fragment-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ export class FragmentTracker extends EventHandler {
// Check if any flagged fragments have been unloaded
for (let fragmentEntity of this.fragments.values()) {
if(fragmentEntity.buffered === true) {
fragmentTimes = fragmentEntity.range[elementaryStream].time;
for (let i = 0; i < fragmentTimes.length; i++) {
time = fragmentTimes[i];

if(this.isTimeBuffered(time.startPTS, time.endPTS, timeRange) === false) {
// Unregister partial fragment as it needs to load again to be reused
this.removeFragment(fragmentEntity.body);
break;
const esData = fragmentEntity.range[elementaryStream];
if (esData) {
fragmentTimes = esData.time;
for (let i = 0; i < fragmentTimes.length; i++) {
time = fragmentTimes[i];

if(this.isTimeBuffered(time.startPTS, time.endPTS, timeRange) === false) {
// Unregister partial fragment as it needs to load again to be reused
this.removeFragment(fragmentEntity.body);
break;
}
}
}
}
Expand Down

0 comments on commit ad3b10d

Please sign in to comment.