mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-10-26 16:45:09 +00:00
Backport pull request #18309 from jellyfin/release-12.z
Fix crash when a subtitle charset has no .NET encoding
Original-merge: 2f5be2df9b
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Bond_009 <bond.009@outlook.com>
This commit is contained in:
1 parent
054706333d
commit
f624cb4cc5
3 files changed
+49
No files matched your search
@@ -188,6 +188,14 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
|
||||
_logger.LogDebug("charset {CharSet} detected for {Path}", detected.EncodingName, fileInfo.Path);
|
||||
|
||||
// If encoding is not supported by .NET (e.g., ISO-8859-16), return stream as-is
|
||||
// The charset name will be passed to ffmpeg via -sub_charenc if needed
|
||||
if (detected.Encoding is null)
|
||||
{
|
||||
_logger.LogWarning("Encoding {Encoding} is not supported by .NET for {Path}, returning stream as-is", detected.EncodingName, fileInfo.Path);
|
||||
return stream;
|
||||
}
|
||||
|
||||
await using (stream.ConfigureAwait(false))
|
||||
{
|
||||
using var reader = new StreamReader(stream, detected.Encoding);
|
||||
|
||||
Reference in new issue
Block a user