@torrent-tv/proxy 2.80.8 → 2.80.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1666 -1658
- package/bin/cli.js +606 -596
- package/package.json +1 -1
- package/services/encode/CoverageMap.js +428 -401
- package/services/encode/SegmentStore.js +718 -669
- package/services/hls-session-manager.js +7 -19
- package/services/memory-report.js +596 -592
- package/services/orchestrators/EncodeOrchestrator.js +726 -594
- package/test/coverage-follows-the-disk.test.js +187 -0
- package/test/coverage-map.test.js +195 -178
- package/test/encode-plan.test.js +539 -540
- package/test/run-intervals.test.js +100 -100
- package/test/segment-store.test.js +216 -187
|
@@ -3801,7 +3801,6 @@ export class HlsSessionManager {
|
|
|
3801
3801
|
const staleAfterMs = this.presenceStaleAfterMs();
|
|
3802
3802
|
const now = Date.now();
|
|
3803
3803
|
for (const [address, sessions] of byOutput) {
|
|
3804
|
-
const coverage = this.encodeOrchestrator.coverageOf(address);
|
|
3805
3804
|
// From the TIMELINE, which is where how a file is cut has lived since
|
|
3806
3805
|
// 2.76.0. Read off the session it left, this was `undefined` on every
|
|
3807
3806
|
// session ever made: the map then held no length, and the walk that
|
|
@@ -3810,9 +3809,8 @@ export class HlsSessionManager {
|
|
|
3810
3809
|
// 2026-09-05 with the stack read out of the live process.
|
|
3811
3810
|
const segmentCount = Number(sessions[0].timeline?.segmentCount) || 0;
|
|
3812
3811
|
if (segmentCount > 0) {
|
|
3813
|
-
|
|
3812
|
+
this.encodeOrchestrator.setSegmentCount(address, segmentCount);
|
|
3814
3813
|
}
|
|
3815
|
-
coverage.markReadyAll(this.segmentStore.provenNumbers(address));
|
|
3816
3814
|
for (const session of sessions) {
|
|
3817
3815
|
for (const run of liveRunsOf(session)) {
|
|
3818
3816
|
this.encodeOrchestrator.adopt(address, run);
|
|
@@ -5418,22 +5416,12 @@ export class HlsSessionManager {
|
|
|
5418
5416
|
* @returns {number} The last number to work through, or `-1` for the end.
|
|
5419
5417
|
*/
|
|
5420
5418
|
#runEndFrom(session, startIndex, exceptRun = null) {
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
if (segmentCount > 0) {
|
|
5428
|
-
coverage.setSegmentCount(segmentCount);
|
|
5429
|
-
}
|
|
5430
|
-
coverage.markReadyAll(this.segmentStore.provenNumbers(key));
|
|
5431
|
-
const free = coverage.freeRunFrom(Math.max(0, startIndex), exceptRun);
|
|
5432
|
-
if (!Number.isFinite(free)) {
|
|
5433
|
-
return -1;
|
|
5434
|
-
}
|
|
5435
|
-
const end = Math.max(0, startIndex) + Math.max(1, free) - 1;
|
|
5436
|
-
return segmentCount > 0 && end >= segmentCount - 1 ? -1 : end;
|
|
5419
|
+
return this.encodeOrchestrator.freeStretchEnd({
|
|
5420
|
+
address: session.outputKey ?? "",
|
|
5421
|
+
from: startIndex,
|
|
5422
|
+
exceptRun,
|
|
5423
|
+
segmentCount: Number(session.timeline?.segmentCount) || 0
|
|
5424
|
+
});
|
|
5437
5425
|
}
|
|
5438
5426
|
|
|
5439
5427
|
// Returns the encoder it built, or nothing when there was nothing to build.
|