@torrent-tv/proxy 2.107.100 → 2.107.102

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torrent-tv/proxy",
3
- "version": "2.107.100",
3
+ "version": "2.107.102",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
@@ -11,7 +11,7 @@
11
11
  import { isOutputName, OUTPUT_UNAVAILABLE } from "./output/index.js";
12
12
  import { masterPlaylistText, PLAYLIST_FILE_NAME } from "./output/playlists.js";
13
13
  import { variantHeightsFor } from "./output/ladder.js";
14
- import { isSameMaterial, outputSuits } from "./quality/serving-output.js";
14
+ import { isSameMaterial, outputSuits, pictureKeyOf } from "./quality/serving-output.js";
15
15
  import { SOUNDTRACK_MODE_CAUSE, chooseSoundtrackMode, linkAnswerFigures, linkCouldCarry, loadOf, soundtrackLoadOf, videoLoadOfLimit, videoLoadOfSpec } from "./quality/link-budget.js";
16
16
  import { maxrateKbpsFor } from "./args.js";
17
17
  /**
@@ -47,7 +47,7 @@ export class Renditions {
47
47
  #presetSpeedWaitSaid = new Set();
48
48
 
49
49
  /**
50
- * @param {object} host - `viewerSecondsOn`, `audioStartSecondsFor`, `activeOutputFor`, `viewersOf`, `audioRenditionName`, `logger`, `placeViewer`, `viewerLeaves`, `createOrGetSession`, `planEncodersSoon`, `disposeSession`, `viewerPositionOf`, `encodeRuns`, `fileStartTimeReads`, `getCachedAudioTracks`, `getCachedMediaInfo`, `getContainerMediaInfo`, `localBaseUrl`, `outputTimes`, `outputs`, `quality`, `qualityOffer`, `segmentDurationSec`, `sourceFiles`, `viewers`, `generationOfRequest`, `givenOutputOf`, `noteGivenOutput`, `chosenOutputOf`, `chooseOutput`, `storedPieceReady`, `headersCompatible`, `audioChoiceOf`, `linkMbpsOf`, `qualityModeOf`, `noteServingVerdict`, `limitsFor`, `heightsChosenAs`, `highestGivenSegmentOf`, `sameHeightSwitchOf`, `noteSameHeightSwitch`, `switchingOnto`, `switchingFrom`, `segmentClosed`, `secondsUntilClosed`, `invalidateWaits`, `bufferedSecondsOf`, `minimumBufferSecondsFor`, `processingSpeedOf`, `requiredSpeedOf`
50
+ * @param {object} host - `viewerSecondsOn`, `audioStartSecondsFor`, `activeOutputFor`, `viewersOf`, `audioRenditionName`, `logger`, `placeViewer`, `viewerLeaves`, `createOrGetSession`, `planEncodersSoon`, `disposeSession`, `viewerPositionOf`, `encodeRuns`, `fileStartTimeReads`, `getCachedAudioTracks`, `getCachedMediaInfo`, `getContainerMediaInfo`, `localBaseUrl`, `outputTimes`, `outputs`, `quality`, `qualityOffer`, `segmentDurationSec`, `sourceFiles`, `viewers`, `generationOfRequest`, `givenOutputOf`, `noteGivenOutput`, `chosenOutputOf`, `chooseOutput`, `storedPieceReady`, `headersCompatible`, `audioChoiceOf`, `linkMbpsOf`, `qualityModeOf`, `noteServingVerdict`, `limitsFor`, `heightsChosenAs`, `highestGivenSegmentOf`, `givenUnderOtherPictureOf`, `sameHeightSwitchOf`, `noteSameHeightSwitch`, `switchingOnto`, `switchingFrom`, `segmentClosed`, `secondsUntilClosed`, `invalidateWaits`, `bufferedSecondsOf`, `minimumBufferSecondsFor`, `processingSpeedOf`, `requiredSpeedOf`
51
51
  */
52
52
  constructor(host) {
53
53
  this.#host = host;
@@ -946,7 +946,7 @@ export class Renditions {
946
946
  }
947
947
  const generation = this.#host.generationOfRequest(consumerId, Number.NaN);
948
948
  const given = askedHeights.some((height) =>
949
- this.#host.givenOutputOf(consumerId, generation, height, segment) === current.outputKey);
949
+ this.#host.givenOutputOf(consumerId, generation, pictureKeyOf(current.spec), height, segment) === current.outputKey);
950
950
  return given && !this.#host.segmentClosed(current.outputKey, segment) ? segment : null;
951
951
  }
952
952
 
@@ -966,7 +966,7 @@ export class Renditions {
966
966
  * @returns {number}
967
967
  */
968
968
  #nextSegmentOf(base, consumerId, askedHeights, prepared) {
969
- const highest = Math.max(-1, ...askedHeights.map((height) => this.#host.highestGivenSegmentOf(consumerId, height)));
969
+ const highest = Math.max(-1, ...askedHeights.map((height) => this.#host.highestGivenSegmentOf(consumerId, pictureKeyOf(base.spec), height)));
970
970
  if (highest >= 0) {
971
971
  return highest + 1;
972
972
  }
@@ -1095,8 +1095,9 @@ export class Renditions {
1095
1095
  // given to the prepared output, and is answered from there.
1096
1096
  const generation = this.#host.generationOfRequest(consumerId, Number.NaN);
1097
1097
  for (const height of move.askedHeights) {
1098
- if (this.#host.givenOutputOf(consumerId, generation, height, from) === current.outputKey) {
1099
- this.#host.noteGivenOutput(consumerId, generation, height, from, prepared.outputKey ?? "");
1098
+ const picture = pictureKeyOf(current.spec);
1099
+ if (this.#host.givenOutputOf(consumerId, generation, picture, height, from) === current.outputKey) {
1100
+ this.#host.noteGivenOutput(consumerId, generation, picture, height, from, prepared.outputKey ?? "");
1100
1101
  }
1101
1102
  }
1102
1103
  }
@@ -1327,8 +1328,15 @@ export class Renditions {
1327
1328
  * @returns {{ state: "none" } | { state: "live", output: HlsSession } | { state: "gone", key: string }}
1328
1329
  */
1329
1330
  #givenBefore(base, consumerId, generation, height, segmentIndex) {
1330
- const key = this.#host.givenOutputOf(consumerId, generation, height, segmentIndex);
1331
+ const picture = pictureKeyOf(base.spec);
1332
+ const key = this.#host.givenOutputOf(consumerId, generation, picture, height, segmentIndex);
1331
1333
  if (!key) {
1334
+ const other = this.#host.givenUnderOtherPictureOf(consumerId, generation, picture, height, segmentIndex);
1335
+ if (other) {
1336
+ this.#host.logger.info(
1337
+ `given: ${base.id} #${segmentIndex} not answered by ${other.pictureKey}'s record`
1338
+ );
1339
+ }
1332
1340
  return { state: "none" };
1333
1341
  }
1334
1342
  const output = this.#interchangeableWith(base, base.spec).find((other) => other.outputKey === key) ?? null;
@@ -1377,7 +1385,7 @@ export class Renditions {
1377
1385
  const verdict = current ? this.#host.headersCompatible(goneKey, current.outputKey ?? "") : null;
1378
1386
  if (current && verdict?.compatible) {
1379
1387
  this.#host.placeViewerOn(current, consumerId, this.#host.viewerPositionOf(base.id, consumerId));
1380
- this.#host.noteGivenOutput(consumerId, generation, height, segmentIndex, current.outputKey ?? "");
1388
+ this.#host.noteGivenOutput(consumerId, generation, pictureKeyOf(base.spec), height, segmentIndex, current.outputKey ?? "");
1381
1389
  this.#host.logger.info(
1382
1390
  `transcode ${base.id} ${fileName} for ${consumerId}: ${goneKey} has gone; served by ` +
1383
1391
  `${current.outputKey}, whose header is compatible with it`
@@ -1470,7 +1478,7 @@ export class Renditions {
1470
1478
  return true;
1471
1479
  }
1472
1480
  const generation = this.#host.generationOfRequest(consumerId, statedGeneration);
1473
- const key = this.#host.givenOutputOf(consumerId, generation, height, index);
1481
+ const key = this.#host.givenOutputOf(consumerId, generation, pictureKeyOf(base.spec), height, index);
1474
1482
  return !key || key === waitedOn.outputKey;
1475
1483
  }
1476
1484
 
@@ -1560,7 +1568,7 @@ export class Renditions {
1560
1568
  this.#host.placeViewerOn(variant, consumerId, this.#host.viewerPositionOf(baseSessionId, consumerId));
1561
1569
  // Recorded AFTER placing them: a viewer this request is the first sign of
1562
1570
  // exists only from that moment, and a record kept for nobody is lost.
1563
- this.#host.noteGivenOutput(consumerId, generation, height, segmentIndex, variant.outputKey ?? "");
1571
+ this.#host.noteGivenOutput(consumerId, generation, pictureKeyOf(base.spec), height, segmentIndex, variant.outputKey ?? "");
1564
1572
  }
1565
1573
  // WHICH RUNG IS ON THE SCREEN IS NOT READ OFF THIS REQUEST. The page says
1566
1574
  // so itself (`viewerPlays`), the moment the player has switched: a request
@@ -412,3 +412,28 @@ export class OutputSpec {
412
412
  export function isOutputName(value) {
413
413
  return typeof value === "string" && /^[a-f0-9]{16}$/.test(value);
414
414
  }
415
+
416
+ /**
417
+ * The picture an output belongs to: the material identity every output of one
418
+ * film shares, a base and every step of it — the same source, segment format,
419
+ * cuts, carried tracks, video file and soundtrack, and not the picture SIZE.
420
+ * `isSameMaterial` (`encode/quality/serving-output.js`) compares exactly this
421
+ * value, so the two cannot disagree; the viewers' record of what was given
422
+ * (`viewer/Assignments.js`) puts it in every address.
423
+ *
424
+ * @param {OutputSpec | null | undefined} spec
425
+ * @returns {string} Empty when the output has no picture.
426
+ */
427
+ export function pictureKeyOf(spec) {
428
+ if (!spec?.video) {
429
+ return "";
430
+ }
431
+ return [
432
+ spec.sourceKey,
433
+ spec.segmentFormatId,
434
+ spec.grid.toKey(),
435
+ spec.carries,
436
+ spec.video.fileIndex,
437
+ spec.audio?.toKey() ?? ""
438
+ ].join("|");
439
+ }
@@ -1,5 +1,5 @@
1
1
  export { OutputRetention, leastNeededSegments } from "./OutputRetention.js";
2
- export { OutputSpec, VideoOutput, AudioOutput, CutGrid, isOutputName } from "./OutputSpec.js";
2
+ export { OutputSpec, VideoOutput, AudioOutput, CutGrid, isOutputName, pictureKeyOf } from "./OutputSpec.js";
3
3
  export { PLAYLIST_FILE_NAME } from "./playlists.js";
4
4
  export { cutsAtGivenTimes } from "./cut-grid.js";
5
5
 
@@ -27,7 +27,7 @@
27
27
  * No reading of disk or machine here: every figure arrives as a plain value.
28
28
  */
29
29
 
30
- import { OutputSpec } from "../output/OutputSpec.js";
30
+ import { OutputSpec, pictureKeyOf } from "../output/OutputSpec.js";
31
31
  import { admissionRank } from "./link-budget.js";
32
32
 
33
33
  /**
@@ -140,16 +140,16 @@ export function isSameMaterial(spec, wanted) {
140
140
  if (!spec || !wanted || !spec.video || !wanted.video) {
141
141
  return false;
142
142
  }
143
- return (
144
- spec.sourceKey === wanted.sourceKey &&
145
- spec.segmentFormatId === wanted.segmentFormatId &&
146
- spec.grid.toKey() === wanted.grid.toKey() &&
147
- spec.carries === wanted.carries &&
148
- spec.video.fileIndex === wanted.video.fileIndex &&
149
- (spec.audio?.toKey() ?? "") === (wanted.audio?.toKey() ?? "")
150
- );
143
+ return pictureKeyOf(spec) === pictureKeyOf(wanted);
151
144
  }
152
145
 
146
+ /**
147
+ * The picture key: the value `isSameMaterial` compares, the same for a base and
148
+ * every step of it. Defined with the output spec, where its fields live, and
149
+ * named here beside the rule that uses it.
150
+ */
151
+ export { pictureKeyOf };
152
+
153
153
  export function servingCandidates({ wanted, keys, source, encoderName, readyAt }) {
154
154
  const found = new Map();
155
155
  for (const key of keys ?? []) {
@@ -9,7 +9,7 @@
9
9
 
10
10
  import { megabytesPerSecond } from "../../utils/units.js";
11
11
  import { logger } from "../../utils/logger.js";
12
- import { isOutputName, OutputSpec } from "../encode/output/index.js";
12
+ import { isOutputName, OutputSpec, pictureKeyOf } from "../encode/output/index.js";
13
13
  import { withSubtitleReadiness } from "./subtitle-readiness.js";
14
14
 
15
15
  /** @param {{ spec: { sourceFileIndexes: number[] }, file: { fileIndex: number } }} output */
@@ -640,7 +640,7 @@ export class ViewerRequests {
640
640
  }
641
641
  const height = this.#host.outputs.variantHeightOf(output);
642
642
  const generation = this.#host.generationOfRequest(consumerId, statedGeneration);
643
- this.#host.noteGivenOutput(consumerId, generation, height, segmentIndex, output.outputKey ?? "");
643
+ this.#host.noteGivenOutput(consumerId, generation, pictureKeyOf(output.spec), height, segmentIndex, output.outputKey ?? "");
644
644
  }
645
645
 
646
646
  /**
@@ -41,9 +41,21 @@
41
41
  * before an output is let go, rather than the assignments being discovered
42
42
  * afterwards.
43
43
  *
44
- * LIMIT, stated rather than left to be found: an assignment is keyed by the
45
- * HEIGHT asked for, so it speaks for the picture and its steps. A soundtrack is
46
- * not a height and records nothing in `given`; item 97 is about the picture.
44
+ * AN ADDRESS NAMES THE PICTURE. A viewer outlives the picture: a page that
45
+ * opens a second file keeps its consumer id and its generation. What `given`
46
+ * holds for the first picture must never answer a request that names the
47
+ * second, so the address of a given piece is the picture key
48
+ * (`pictureKeyOf`, the material identity `isSameMaterial` compares: the same
49
+ * for a base and every step of it), the height asked for and the segment. A
50
+ * request names the picture (`/transcode/<base>/…`), and so does the address.
51
+ * `chosen` is per height only and stays so: its reader, `servingOutputFor`,
52
+ * already filters by `#interchangeableWith`, so a chosen output of another
53
+ * picture is never served.
54
+ *
55
+ * LIMIT, stated rather than left to be found: within one picture an assignment
56
+ * is keyed by the HEIGHT asked for, so it speaks for the picture and its steps.
57
+ * A soundtrack is not a height and records nothing in `given`; item 97 is about
58
+ * the picture.
47
59
  * A soundtrack's response is still held by `accept` while it is being sent,
48
60
  * and a request for a soundtrack made in a viewing that was left is still
49
61
  * refused — neither of those is about heights.
@@ -77,14 +89,26 @@
77
89
  */
78
90
 
79
91
  /**
80
- * The address of one thing asked for: a height of the picture and a segment.
92
+ * The address of one thing asked for: a picture, a height of it and a segment.
81
93
  *
94
+ * @param {string} pictureKey
82
95
  * @param {number} askedHeight
83
96
  * @param {number} segmentIndex
84
97
  * @returns {string}
85
98
  */
86
- function addressOf(askedHeight, segmentIndex) {
87
- return `${askedHeight}:${segmentIndex}`;
99
+ function addressOf(pictureKey, askedHeight, segmentIndex) {
100
+ return `${addressPrefix(pictureKey, askedHeight)}${segmentIndex}`;
101
+ }
102
+
103
+ /**
104
+ * What every address of one picture and height begins with.
105
+ *
106
+ * @param {string} pictureKey
107
+ * @param {number} askedHeight
108
+ * @returns {string}
109
+ */
110
+ function addressPrefix(pictureKey, askedHeight) {
111
+ return `${pictureKey}#${askedHeight}:`;
88
112
  }
89
113
 
90
114
  export class Assignments {
@@ -216,15 +240,16 @@ export class Assignments {
216
240
  * which only the caller can turn into a number.
217
241
  *
218
242
  * @param {number} generation
243
+ * @param {string} pictureKey
219
244
  * @param {number} askedHeight
220
245
  * @returns {number}
221
246
  */
222
- highestGiven(generation, askedHeight) {
247
+ highestGiven(generation, pictureKey, askedHeight) {
223
248
  const byAddress = this.#given.get(generation);
224
249
  if (!byAddress) {
225
250
  return -1;
226
251
  }
227
- const prefix = `${askedHeight}:`;
252
+ const prefix = addressPrefix(pictureKey, askedHeight);
228
253
  let highest = -1;
229
254
  for (const address of byAddress.keys()) {
230
255
  if (!address.startsWith(prefix)) {
@@ -242,12 +267,37 @@ export class Assignments {
242
267
  * What answered this segment in this generation, or an empty string.
243
268
  *
244
269
  * @param {number} generation
270
+ * @param {string} pictureKey
245
271
  * @param {number} askedHeight
246
272
  * @param {number} segmentIndex
247
273
  * @returns {string}
248
274
  */
249
- givenFor(generation, askedHeight, segmentIndex) {
250
- return this.#given.get(generation)?.get(addressOf(askedHeight, segmentIndex)) ?? "";
275
+ givenFor(generation, pictureKey, askedHeight, segmentIndex) {
276
+ return this.#given.get(generation)?.get(addressOf(pictureKey, askedHeight, segmentIndex)) ?? "";
277
+ }
278
+
279
+ /**
280
+ * What answered this height and segment in this generation under ANOTHER
281
+ * picture, if anything did. Asked only to say so in the log when an address
282
+ * of this picture found no record while one of another picture exists.
283
+ *
284
+ * @param {number} generation
285
+ * @param {string} pictureKey - The picture asked about; its own records are skipped.
286
+ * @param {number} askedHeight
287
+ * @param {number} segmentIndex
288
+ * @returns {{ pictureKey: string, outputKey: string } | null}
289
+ */
290
+ givenUnderOtherPicture(generation, pictureKey, askedHeight, segmentIndex) {
291
+ const suffix = `#${askedHeight}:${segmentIndex}`;
292
+ for (const [address, outputKey] of this.#given.get(generation) ?? []) {
293
+ if (address.endsWith(suffix)) {
294
+ const other = address.slice(0, -suffix.length);
295
+ if (other !== pictureKey) {
296
+ return { pictureKey: other, outputKey };
297
+ }
298
+ }
299
+ }
300
+ return null;
251
301
  }
252
302
 
253
303
  /**
@@ -255,17 +305,18 @@ export class Assignments {
255
305
  * way rather than decided again.
256
306
  *
257
307
  * @param {number} generation
308
+ * @param {string} pictureKey
258
309
  * @param {number} askedHeight
259
310
  * @param {number} segmentIndex
260
311
  * @param {string} outputKey
261
312
  * @returns {void}
262
313
  */
263
- give(generation, askedHeight, segmentIndex, outputKey) {
264
- if (!outputKey || !(askedHeight > 0) || !Number.isInteger(segmentIndex)) {
314
+ give(generation, pictureKey, askedHeight, segmentIndex, outputKey) {
315
+ if (!outputKey || !pictureKey || !(askedHeight > 0) || !Number.isInteger(segmentIndex)) {
265
316
  return;
266
317
  }
267
318
  const byAddress = this.#given.get(generation) ?? new Map();
268
- byAddress.set(addressOf(askedHeight, segmentIndex), outputKey);
319
+ byAddress.set(addressOf(pictureKey, askedHeight, segmentIndex), outputKey);
269
320
  this.#given.set(generation, byAddress);
270
321
  }
271
322
 
@@ -420,9 +420,26 @@ export function acceptsGeneration(viewers, consumerId, stated, now = Date.now())
420
420
  * @param {number} segmentIndex - −1 for the init.
421
421
  * @returns {string}
422
422
  */
423
- export function givenOutputOf(viewers, consumerId, generation, askedHeight, segmentIndex) {
423
+ export function givenOutputOf(viewers, consumerId, generation, pictureKey, askedHeight, segmentIndex) {
424
424
  const viewer = consumerId ? viewers.get(consumerId) : null;
425
- return viewer ? viewer.assignments.givenFor(generation, askedHeight, segmentIndex) : "";
425
+ return viewer ? viewer.assignments.givenFor(generation, pictureKey, askedHeight, segmentIndex) : "";
426
+ }
427
+
428
+ /**
429
+ * What answered this address in this generation under another picture, if
430
+ * anything did: the record that must not answer it.
431
+ *
432
+ * @param {object} viewers
433
+ * @param {string} consumerId
434
+ * @param {number} generation
435
+ * @param {string} pictureKey
436
+ * @param {number} askedHeight
437
+ * @param {number} segmentIndex
438
+ * @returns {{ pictureKey: string, outputKey: string } | null}
439
+ */
440
+ function givenUnderOtherPictureOf(viewers, consumerId, generation, pictureKey, askedHeight, segmentIndex) {
441
+ const viewer = consumerId ? viewers.get(consumerId) : null;
442
+ return viewer ? viewer.assignments.givenUnderOtherPicture(generation, pictureKey, askedHeight, segmentIndex) : null;
426
443
  }
427
444
 
428
445
  /**
@@ -437,9 +454,9 @@ export function givenOutputOf(viewers, consumerId, generation, askedHeight, segm
437
454
  * @param {string} outputKey
438
455
  * @returns {void}
439
456
  */
440
- export function noteGivenOutput(viewers, consumerId, generation, askedHeight, segmentIndex, outputKey) {
457
+ export function noteGivenOutput(viewers, consumerId, generation, pictureKey, askedHeight, segmentIndex, outputKey) {
441
458
  const viewer = consumerId ? viewers.get(consumerId) : null;
442
- viewer?.assignments.give(generation, askedHeight, segmentIndex, outputKey);
459
+ viewer?.assignments.give(generation, pictureKey, askedHeight, segmentIndex, outputKey);
443
460
  }
444
461
 
445
462
  /**
@@ -528,9 +545,9 @@ export function heightsChosenAs(viewers, consumerId, outputKey) {
528
545
  * @param {number} askedHeight
529
546
  * @returns {number}
530
547
  */
531
- export function highestGivenSegmentOf(viewers, consumerId, askedHeight) {
548
+ export function highestGivenSegmentOf(viewers, consumerId, pictureKey, askedHeight) {
532
549
  const viewer = consumerId ? viewers.get(consumerId) : null;
533
- return viewer ? viewer.assignments.highestGiven(viewer.assignments.generation, askedHeight) : -1;
550
+ return viewer ? viewer.assignments.highestGiven(viewer.assignments.generation, pictureKey, askedHeight) : -1;
534
551
  }
535
552
 
536
553
  /**
@@ -709,17 +726,20 @@ export function viewerRelationsFor(viewers) {
709
726
  // A viewer's own assignments: which output answered a height and segment in
710
727
  // one generation of their viewing, so a repeat is answered the same way.
711
728
  generationOfRequest: (consumerId, stated) => generationOfRequest(viewers, consumerId, stated),
712
- givenOutputOf: (consumerId, generation, askedHeight, segmentIndex) =>
713
- givenOutputOf(viewers, consumerId, generation, askedHeight, segmentIndex),
714
- noteGivenOutput: (consumerId, generation, askedHeight, segmentIndex, outputKey) =>
715
- noteGivenOutput(viewers, consumerId, generation, askedHeight, segmentIndex, outputKey),
729
+ givenOutputOf: (consumerId, generation, pictureKey, askedHeight, segmentIndex) =>
730
+ givenOutputOf(viewers, consumerId, generation, pictureKey, askedHeight, segmentIndex),
731
+ givenUnderOtherPictureOf: (consumerId, generation, pictureKey, askedHeight, segmentIndex) =>
732
+ givenUnderOtherPictureOf(viewers, consumerId, generation, pictureKey, askedHeight, segmentIndex),
733
+ noteGivenOutput: (consumerId, generation, pictureKey, askedHeight, segmentIndex, outputKey) =>
734
+ noteGivenOutput(viewers, consumerId, generation, pictureKey, askedHeight, segmentIndex, outputKey),
716
735
  // The output this viewer was chosen at a height, and the rule's choice of
717
736
  // it — the viewer's own record, never one per file.
718
737
  chosenOutputOf: (consumerId, askedHeight) => chosenOutputOf(viewers, consumerId, askedHeight),
719
738
  chooseOutput: (consumerId, askedHeight, outputKey) => chooseOutput(viewers, consumerId, askedHeight, outputKey),
720
739
  noteServingVerdict: (consumerId, verdict) => noteServingVerdict(viewers, consumerId, verdict),
721
740
  heightsChosenAs: (consumerId, outputKey) => heightsChosenAs(viewers, consumerId, outputKey),
722
- highestGivenSegmentOf: (consumerId, askedHeight) => highestGivenSegmentOf(viewers, consumerId, askedHeight),
741
+ highestGivenSegmentOf: (consumerId, pictureKey, askedHeight) =>
742
+ highestGivenSegmentOf(viewers, consumerId, pictureKey, askedHeight),
723
743
  // A move between two limits of the height on a viewer's screen: the segment
724
744
  // they were last given, the move being prepared, and the outputs it is
725
745
  // between.