Skip to content

Commit

Permalink
update syntax and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkim9 committed Dec 20, 2017
1 parent c3e7dc1 commit 15668ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/controller/audio-stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class AudioStreamController extends EventHandler {
if (!isNaN(frag.sn)) {
this.nextLoadPosition = frag.start + frag.duration;
}
hls.trigger(Event.FRAG_LOADING, {frag: frag});
hls.trigger(Event.FRAG_LOADING, {frag});
this.state = State.FRAG_LOADING;
}
}
Expand Down Expand Up @@ -664,6 +664,7 @@ class AudioStreamController extends EventHandler {
}

if(!fragCurrent.mediaChannels) {
// Set is used because the elements do not repeat
fragCurrent.mediaChannels = new Set();
}
fragCurrent.mediaChannels.add(data.type);
Expand Down
9 changes: 2 additions & 7 deletions src/controller/buffer-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,9 @@ class BufferController extends EventHandler {
// count nb of pending segments waiting for appending on this sourcebuffer
let pending = this.segments.reduce( (counter, segment) => (segment.parent === parent) ? counter + 1 : counter , 0);


// this.sourceBuffer is better to use than media.buffered as it is closer to the PTS data from the fragments
let timeRanges = new Map();
for (let type in this.sourceBuffer) {
if (this.sourceBuffer.hasOwnProperty(type)) {
timeRanges.set(type, this.sourceBuffer[type].buffered);
}
}
const bufferedEntries = Object.entries(this.sourceBuffer).map(([k,v]) => [k, v.buffered]);
const timeRanges = new Map(bufferedEntries);

this.hls.trigger(Event.BUFFER_APPENDED, { parent, pending, timeRanges });
// don't append in flushing mode
Expand Down
1 change: 1 addition & 0 deletions src/controller/stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,7 @@ class StreamController extends EventHandler {
}

if(!frag.mediaChannels) {
// Set is used because the elements do not repeat
frag.mediaChannels = new Set();
}
frag.mediaChannels.add(data.type);
Expand Down

0 comments on commit 15668ca

Please sign in to comment.