@torrent-tv/proxy 2.101.15 → 2.101.17
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/package.json
CHANGED
|
@@ -409,7 +409,8 @@ export class EncodeRuns {
|
|
|
409
409
|
* @param {string | null} [following] - The working name of the file the muxer closed after it.
|
|
410
410
|
* @returns {object | null | false}
|
|
411
411
|
*/
|
|
412
|
-
#wholeClosedPiece(session, name, index, admitted = false, bytes = null, run = null, timing = null, following = null,
|
|
412
|
+
#wholeClosedPiece(session, name, index, admitted = false, bytes = null, run = null, timing = null, following = null,
|
|
413
|
+
{ tentative = false, audioOnPublishedGrid = false } = {}) {
|
|
413
414
|
|
|
414
415
|
const format = session.segmentFormat;
|
|
415
416
|
if (!format?.readMediaRanges || !Number.isInteger(index) || index < 0) {
|
|
@@ -422,6 +423,9 @@ export class EncodeRuns {
|
|
|
422
423
|
const cut = cutOf(session.timeline, index);
|
|
423
424
|
const grid = session.timeline.published ?? session.timeline.boundaries;
|
|
424
425
|
const interval = admitted ? { from: grid?.[index], to: grid?.[index + 1],
|
|
426
|
+
// Embedded copied sound was selected by presentationSegment on the
|
|
427
|
+
// published grid, so its raw muxer cut shift no longer applies.
|
|
428
|
+
...(audioOnPublishedGrid ? { shiftByKind: { soun: 0 } } : {}),
|
|
425
429
|
...(index === session.timeline.segmentCount - 1 ? { endsWithSource: true, sourceEnds: Object.fromEntries(
|
|
426
430
|
(admitted.tracks ?? []).filter(input => Number.isFinite(input.sourceEndSeconds))
|
|
427
431
|
.map(input => [input.track.type === "video" ? "vide" : "soun", input.sourceEndSeconds])) } : {}),
|
|
@@ -1181,7 +1185,8 @@ export class EncodeRuns {
|
|
|
1181
1185
|
throw error;
|
|
1182
1186
|
}
|
|
1183
1187
|
}
|
|
1184
|
-
const mediaRanges = this.#wholeClosedPiece(session, name, index, admittedInput, bytes, run, timing, following,
|
|
1188
|
+
const mediaRanges = this.#wholeClosedPiece(session, name, index, admittedInput, bytes, run, timing, following,
|
|
1189
|
+
{ tentative, audioOnPublishedGrid: soundInPiece });
|
|
1185
1190
|
// Tried on its own line and not proved whole: it waits for the next file.
|
|
1186
1191
|
if (mediaRanges === false && tentative) return null;
|
|
1187
1192
|
if (mediaRanges === false) throw Object.assign(new Error(`Closed piece #${index} has incomplete media.`),
|
|
@@ -855,10 +855,18 @@ export class Renditions {
|
|
|
855
855
|
}
|
|
856
856
|
// A segment closed on the output a viewer is LEAVING may be the one their
|
|
857
857
|
// move waits for (`#givenAndOpenOn`). It is behind the segment the move
|
|
858
|
-
// begins at by construction, so it is asked about with no index.
|
|
858
|
+
// begins at by construction, so it is asked about with no index. A move
|
|
859
|
+
// is about its prepared picture: a separate soundtrack is not an output
|
|
860
|
+
// the viewer is leaving from for that move.
|
|
861
|
+
if (output.spec?.carries === "audio-only") {
|
|
862
|
+
continue;
|
|
863
|
+
}
|
|
859
864
|
for (const consumerId of this.#host.switchingFrom?.(output) ?? []) {
|
|
860
|
-
|
|
861
|
-
|
|
865
|
+
const move = this.#host.sameHeightSwitchOf(consumerId);
|
|
866
|
+
const prepared = move ? this.#host.outputs.get(move.outputId) : null;
|
|
867
|
+
const moveBase = prepared ? this.#host.outputs.pictureOf(prepared) : base;
|
|
868
|
+
if (this.#host.activeOutputFor({ base: moveBase, consumerId, outputs: this.#host.outputs }) === output) {
|
|
869
|
+
this.#reconsiderSameHeightSwitch(moveBase, consumerId, null);
|
|
862
870
|
}
|
|
863
871
|
}
|
|
864
872
|
}
|
|
@@ -192,15 +192,16 @@ export function judgeNeighbors(left, right) {
|
|
|
192
192
|
* soundtrack's at 1419.904 s against a final cut of 1419.993 s, and both last
|
|
193
193
|
* pieces were refused, so no viewer could reach the end of the episode.
|
|
194
194
|
*/
|
|
195
|
-
function intervalFailure(coverage, { from, to, requiredKinds, sourceEnds = {}, shift = 0, endsWithSource = false, nextLeadingSeconds = 0 }) {
|
|
195
|
+
function intervalFailure(coverage, { from, to, requiredKinds, sourceEnds = {}, shift = 0, shiftByKind = {}, endsWithSource = false, nextLeadingSeconds = 0 }) {
|
|
196
196
|
if (!Number.isFinite(from) || !Number.isFinite(to) || !(to > from) || !requiredKinds?.length) return "segment-interval-is-not-declared";
|
|
197
197
|
for (const kind of requiredKinds) {
|
|
198
198
|
const track = coverage?.tracks?.find(track => track.kind === kind);
|
|
199
199
|
if (!track?.ranges?.length || !(track.timescale > 0n)) return `segment-missing-${kind}`;
|
|
200
|
-
const
|
|
201
|
-
const
|
|
200
|
+
const trackShift = Number.isFinite(shiftByKind[kind]) ? shiftByKind[kind] : shift;
|
|
201
|
+
const start = BigInt(Math.round((from + trackShift) * Number(track.timescale)));
|
|
202
|
+
const cutAt = to + trackShift - (kind === "vide" && !endsWithSource ? nextLeadingSeconds : 0);
|
|
202
203
|
const through = Number.isFinite(sourceEnds[kind]) ? Math.min(cutAt, sourceEnds[kind]) : cutAt;
|
|
203
|
-
if (!(through > from +
|
|
204
|
+
if (!(through > from + trackShift)) return `segment-interval-is-empty-${kind}`;
|
|
204
205
|
const end = BigInt(Math.round(through * Number(track.timescale)));
|
|
205
206
|
const first = track.ranges[0];
|
|
206
207
|
const frame = track.productionFrame ?? first.frame;
|