omit input container when hw encoding

This commit is contained in:
Luke Pulverenti
2017-03-01 15:29:42 -05:00
parent 5d094874e5
commit a181425e54
4 changed files with 29 additions and 82 deletions

View File

@@ -734,6 +734,16 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
}
var charsetFromLanguage = string.IsNullOrWhiteSpace(language)
? null
: GetSubtitleFileCharacterSetFromLanguage(language);
// This assumption should only be made for external subtitles
if (!string.IsNullOrWhiteSpace(charsetFromLanguage) && !string.Equals(charsetFromLanguage, "windows-1252", StringComparison.OrdinalIgnoreCase))
{
return charsetFromLanguage;
}
var charset = await DetectCharset(path, language, protocol, cancellationToken).ConfigureAwait(false);
if (!string.IsNullOrWhiteSpace(charset))
@@ -746,12 +756,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
return charset;
}
if (!string.IsNullOrWhiteSpace(language))
{
return GetSubtitleFileCharacterSetFromLanguage(language);
}
return null;
return charsetFromLanguage;
}
public string GetSubtitleFileCharacterSetFromLanguage(string language)