@torrent-tv/proxy 2.107.2 → 2.107.4

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.2",
3
+ "version": "2.107.4",
4
4
  "description": "Torrent proxy client that exposes webseed-like HTTP stream endpoint.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
@@ -209,11 +209,13 @@ export class OutputOpening {
209
209
 
210
210
  const normalizedTargetWidth = Number.isInteger(targetWidth) && targetWidth > 0 ? targetWidth : 0;
211
211
  const normalizedTargetHeight = Number.isInteger(targetHeight) && targetHeight > 0 ? targetHeight : 0;
212
- // Round seek position to the nearest 10 s so that two consumers seeking
213
- // to similar positions can share the same ffmpeg session.
214
- const normalizedStartPosition =
212
+ // Where the run is asked to begin, as asked. It names no session: a value
213
+ // rounded to 10 s here was printed as the start and read as where the run
214
+ // began, while the run itself began elsewhere (torrent-tv/meta#104: asked at
215
+ // 18.853 s, logged `start=20s`).
216
+ const requestedStartPosition =
215
217
  Number.isFinite(startPositionSeconds) && startPositionSeconds > 0
216
- ? Math.round(startPositionSeconds / 10) * 10
218
+ ? startPositionSeconds
217
219
  : 0;
218
220
  const normalizedAudioTrack =
219
221
  Number.isInteger(audioTrackIndex) && audioTrackIndex > 0 ? audioTrackIndex : 0;
@@ -728,7 +730,7 @@ export class OutputOpening {
728
730
  // was told to produce: measured 2026-08-06, the session began at #0
729
731
  // while the player asked for #127 and gave up 45.6 s later. Neither
730
732
  // side saying what it meant is why that took three attempts to place.
731
- `start=${Math.round(normalizedStartPosition)}s ` +
733
+ `start=${requestedStartPosition.toFixed(1)}s ` +
732
734
  `video=${transcodeVideo ? `${this.#host.videoEncoder.name}${output.softwarePreset ? `/${output.softwarePreset}` : ""}` : "copy"} ` +
733
735
  `audio=${audioTranscoded ? "aac" : "copy"} ` +
734
736
  // Branch tag for log correlation: A = video re-encode (fixed GOP, grid
@@ -11,6 +11,13 @@ import { logger } from "../../utils/logger.js";
11
11
  import { isOutputName, OutputSpec } from "../encode/output/index.js";
12
12
  import { withSubtitleReadiness } from "./subtitle-readiness.js";
13
13
 
14
+ /** @param {{ spec: { sourceFileIndexes: number[] }, file: { fileIndex: number } }} output */
15
+ export function sourceFileIndexesForOutput(output) {
16
+ return output.spec.sourceFileIndexes.length > 0
17
+ ? [...output.spec.sourceFileIndexes]
18
+ : [output.file.fileIndex];
19
+ }
20
+
14
21
  /**
15
22
  * The segment number an assignment is recorded under for this file, −1 for the
16
23
  * init, or null for anything that is neither (a playlist).
@@ -1044,7 +1051,8 @@ export class ViewerRequests {
1044
1051
  subtitle ? this.#host.subtitleReadyFor?.(viewer) !== false : true);
1045
1052
  forecast.operations = outputs.flatMap((output, index) => {
1046
1053
  const common = { speed: this.#host.playbackReadiness.forecastRate(tracks[index].readings, now, 0, "piece"),
1047
- processedSeconds: tracks[index].processedSeconds };
1054
+ processedSeconds: tracks[index].processedSeconds,
1055
+ sourceFileIndexes: sourceFileIndexesForOutput(output) };
1048
1056
  return [
1049
1057
  ...(output.spec.video ? [{ ...common, track: "video",
1050
1058
  operation: output.spec.transcodesVideo ? "encode" : "copy",