mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-27 04:16:47 +00:00
fix the UTF-16 error while burning ass/ssa subtitles
This commit is contained in:
parent
0e9d9a7897
commit
0af353404c
2 changed files with 11 additions and 1 deletions
|
|
@ -730,6 +730,14 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||
{
|
||||
var charset = CharsetDetector.DetectFromStream(stream).Detected?.EncodingName;
|
||||
|
||||
// UTF16 is automatically converted to UTF8 by FFmpeg, do not specify a character encoding
|
||||
if ((path.EndsWith(".ass") || path.EndsWith(".ssa"))
|
||||
&& (string.Equals(charset, "utf-16le", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(charset, "utf-16be", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
charset = "";
|
||||
}
|
||||
|
||||
_logger.LogDebug("charset {0} detected for {Path}", charset ?? "null", path);
|
||||
|
||||
return charset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue