mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-07 09:01:36 -04:00
Merge pull request #2653 from iwalton3/fix-embedded-subtitles
Fix embedded mkv subtitles. (cherry picked from commit 1345e699fae6e29b4507c5ed3dbddd36523a5e0d) Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
4caa597cde
commit
9da2635d86
@ -183,9 +183,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
|
||||
private async Task<Stream> GetSubtitleStream(string path, MediaProtocol protocol, bool requiresCharset, CancellationToken cancellationToken)
|
||||
{
|
||||
using (var stream = await GetStream(path, protocol, cancellationToken).ConfigureAwait(false))
|
||||
if (requiresCharset)
|
||||
{
|
||||
if (requiresCharset)
|
||||
using (var stream = await GetStream(path, protocol, cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
var result = CharsetDetector.DetectFromStream(stream).Detected;
|
||||
stream.Position = 0;
|
||||
@ -200,9 +200,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
return new MemoryStream(Encoding.UTF8.GetBytes(text));
|
||||
}
|
||||
}
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
return File.OpenRead(path);
|
||||
}
|
||||
|
||||
private async Task<SubtitleInfo> GetReadableFile(
|
||||
|
Loading…
x
Reference in New Issue
Block a user