@torrent-tv/proxy 2.101.17 → 2.101.19
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
|
@@ -423,8 +423,8 @@ export class EncodeRuns {
|
|
|
423
423
|
const cut = cutOf(session.timeline, index);
|
|
424
424
|
const grid = session.timeline.published ?? session.timeline.boundaries;
|
|
425
425
|
const interval = admitted ? { from: grid?.[index], to: grid?.[index + 1],
|
|
426
|
-
//
|
|
427
|
-
//
|
|
426
|
+
// Copied sound is cut on the published grid, so the run's raw muxer
|
|
427
|
+
// clock shift must not be applied to its AAC interval.
|
|
428
428
|
...(audioOnPublishedGrid ? { shiftByKind: { soun: 0 } } : {}),
|
|
429
429
|
...(index === session.timeline.segmentCount - 1 ? { endsWithSource: true, sourceEnds: Object.fromEntries(
|
|
430
430
|
(admitted.tracks ?? []).filter(input => Number.isFinite(input.sourceEndSeconds))
|
|
@@ -1167,12 +1167,15 @@ export class EncodeRuns {
|
|
|
1167
1167
|
const address = session.outputKey ?? "";
|
|
1168
1168
|
// Read before anything rewrites it: when the encoder finished it.
|
|
1169
1169
|
const writtenAt = this.#host.segmentFiles.writtenAtOf?.(address, name) ?? null;
|
|
1170
|
-
const fmp4 = admittedInput && session.segmentFormat.id === "fmp4"
|
|
1170
|
+
const fmp4 = admittedInput && session.segmentFormat.id === "fmp4";
|
|
1171
|
+
const pictureFmp4 = fmp4 && session.spec.carries !== "audio-only";
|
|
1171
1172
|
// The first piece of a run that read the picture from its keyframe:
|
|
1172
1173
|
// its leading pictures are the ones the run before made, or none.
|
|
1173
|
-
const firstOfRun =
|
|
1174
|
+
const firstOfRun = pictureFmp4 && this.#copiesOriginalPicture(session, admittedInput) &&
|
|
1174
1175
|
index === run.from && index > 0 && !fromKeyframeBefore;
|
|
1175
|
-
const soundInPiece =
|
|
1176
|
+
const soundInPiece = pictureFmp4 && session.spec.audio && !this.#host.servesAudioSeparately(session);
|
|
1177
|
+
const audioOnPublishedGrid = fmp4 && session.spec.audio && !session.spec.transcodesAudio &&
|
|
1178
|
+
(session.spec.carries === "audio-only" || !this.#host.servesAudioSeparately(session));
|
|
1176
1179
|
if (firstOfRun || soundInPiece) {
|
|
1177
1180
|
try {
|
|
1178
1181
|
const grid = session.timeline.published ?? session.timeline.boundaries;
|
|
@@ -1186,7 +1189,7 @@ export class EncodeRuns {
|
|
|
1186
1189
|
}
|
|
1187
1190
|
}
|
|
1188
1191
|
const mediaRanges = this.#wholeClosedPiece(session, name, index, admittedInput, bytes, run, timing, following,
|
|
1189
|
-
{ tentative, audioOnPublishedGrid
|
|
1192
|
+
{ tentative, audioOnPublishedGrid });
|
|
1190
1193
|
// Tried on its own line and not proved whole: it waits for the next file.
|
|
1191
1194
|
if (mediaRanges === false && tentative) return null;
|
|
1192
1195
|
if (mediaRanges === false) throw Object.assign(new Error(`Closed piece #${index} has incomplete media.`),
|
|
@@ -430,7 +430,10 @@ export class QualityController {
|
|
|
430
430
|
// it is read as a copy.
|
|
431
431
|
const unchanged = standing && standingBefore &&
|
|
432
432
|
standing.height === standingBefore.height && standing.at === standingBefore.at;
|
|
433
|
-
|
|
433
|
+
const urgentMachineDown = unchanged && standing.urgent === true &&
|
|
434
|
+
standing.reason.startsWith("machine-bound ");
|
|
435
|
+
const machineRecovered = !urgentMachineDown || this.#roomToSpare(session, consumerId);
|
|
436
|
+
if (unchanged && !this.#affirmed.has(consumerId) && machineRecovered) {
|
|
434
437
|
this.#host.dropAskOf(base, consumerId);
|
|
435
438
|
logger.info(
|
|
436
439
|
`[budget] transcode ${base.id} no longer asks ${consumerId} for ${standing.height}p: ` +
|