Merge pull request #14809 from lostb1t/fix/subtitleencoder

fix: prevent premature disposal of HTTP subtitle streams
This commit is contained in:
Niels van Velzen
2026-01-26 12:00:14 +01:00
committed by GitHub
2 changed files with 44 additions and 40 deletions
+2 -2
View File
@@ -1252,11 +1252,11 @@ public class StreamInfo
stream.Index.ToString(CultureInfo.InvariantCulture),
startPositionTicks.ToString(CultureInfo.InvariantCulture),
subtitleProfile.Format);
info.IsExternalUrl = false; // Default to API URL
info.IsExternalUrl = false;
// Check conditions for potentially using the direct path
if (stream.IsExternal // Must be external
&& MediaSource?.Protocol != MediaProtocol.File // Main media must not be a local file
&& stream.SupportsExternalStream
&& string.Equals(stream.Codec, subtitleProfile.Format, StringComparison.OrdinalIgnoreCase) // Format must match (no conversion needed)
&& !string.IsNullOrEmpty(stream.Path) // Path must exist
&& Uri.TryCreate(stream.Path, UriKind.Absolute, out Uri? uriResult) // Path must be an absolute URI