Skip to content

Commit

Permalink
Remove unused codes
Browse files Browse the repository at this point in the history
  • Loading branch information
xqq committed Oct 26, 2016
1 parent 9fa78f6 commit 8aee2ca
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 92 deletions.
37 changes: 0 additions & 37 deletions src/core/media-segment-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,43 +177,6 @@ export class MediaSegmentInfoList {
this._list.splice(insertIdx, 0, msi);
}

removeSegmentsAfter(originalDts) {
let list = this._list;
if (list.length === 0) {
return;
}
let last = list.length - 1;
let mid = 0;
let lbound = 0;
let ubound = last;

let idx = 0;

if (originalDts < list[0].originalBeginDts) {
idx = 0;
lbound = ubound + 1;
}

while (lbound <= ubound) {
mid = lbound + Math.floor((ubound - lbound) / 2);
if (mid === last) { // no segments need to be remove
return;
} else if (list[mid].lastSample.originalDts < originalDts && originalDts <= list[mid + 1].originalBeginDts) {
idx = mid + 1;
break;
} else if (list[mid].originalBeginDts <= originalDts && originalDts < list[mid].originalEndDts) {
idx = mid;
break;
} else if (originalDts > list[mid].lastSample.originalDts) {
lbound = mid + 1;
} else {
ubound = mid - 1;
}
}

this._list.splice(idx, this._list.length - idx);
}

getLastSegmentBefore(originalBeginDts) {
let idx = this._searchNearestSegmentBefore(originalBeginDts);
if (idx >= 0) {
Expand Down
1 change: 0 additions & 1 deletion src/demux/flv-demuxer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Log from '../utils/logger.js';
import AMF from './amf-parser.js';
import BSearch from '../utils/bsearch.js';
import SPSParser from './sps-parser.js';
import DemuxErrors from './demux-errors.js';
import MediaInfo from '../core/media-info.js';
Expand Down
54 changes: 0 additions & 54 deletions src/utils/bsearch.js

This file was deleted.

0 comments on commit 8aee2ca

Please sign in to comment.