fix(subtitles): load external subtitle files with the media whether or not selected
Since a1b6a8971 only the selected sidecar attached at open, so mpv's
track-list carried one external subtitle and the track sheet could only
offer the rest as primary source switches - tap-and-hold on a
non-selected external track selected it as primary instead of secondary.
Real external files are cheap static fetches, so Jellyfin, Plex direct
play, and offline discovery now mark them preload and they ride along in
sub-files at open, keeping every external track selectable as a
secondary subtitle without a reopen. Embedded rows extracted on a
transcode stay lazy: extraction can stall behind the transcoder, which
is exactly what used to trip the sidecar open guard.
close #1860
This commit is contained in:
@@ -500,6 +500,13 @@ mixin _JellyfinPlaybackMethods on _JellyfinClientInternals {
|
||||
externalSubtitles.add(
|
||||
PlaybackSubtitleSidecar(
|
||||
sourceStreamId: track.id,
|
||||
// A real external file is a cheap static fetch, so it loads with the
|
||||
// media whether or not it is selected — that is what lets the track
|
||||
// sheet offer it as a secondary subtitle without a reopen (#1860).
|
||||
// An embedded row extracted on a transcode stays lazy: extraction can
|
||||
// stall while the transcoder spins up, which is exactly what used to
|
||||
// trip the sidecar open guard (#1738).
|
||||
preload: track.isExternalFile,
|
||||
track: SubtitleTrack.uri(
|
||||
url,
|
||||
title:
|
||||
|
||||
@@ -246,6 +246,9 @@ class PlaybackInitializationService {
|
||||
subtitles.add(
|
||||
PlaybackSubtitleSidecar(
|
||||
sourceStreamId: trackId,
|
||||
// Local files cost nothing to attach, and preloading keeps every
|
||||
// downloaded sidecar selectable as a secondary subtitle (#1860).
|
||||
preload: true,
|
||||
track: SubtitleTrack.uri(
|
||||
Uri.file(entity.path).toString(),
|
||||
title: cachedTrack?.displayTitle ?? cachedTrack?.language ?? t.videoControls.subtitleFile(name: fileName),
|
||||
|
||||
@@ -3946,6 +3946,10 @@ class PlexClient
|
||||
externalSubtitles.add(
|
||||
PlaybackSubtitleSidecar(
|
||||
sourceStreamId: plexTrack.id,
|
||||
// Every row here is a real external file: preload it with the
|
||||
// media so the non-selected tracks stay selectable as secondary
|
||||
// subtitles without a reopen (#1860).
|
||||
preload: true,
|
||||
track: SubtitleTrack.uri(
|
||||
url,
|
||||
title:
|
||||
|
||||
Reference in New Issue
Block a user