|
|
@ -681,14 +681,16 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|
|
|
if (!string.Equals(text, newText, StringComparison.Ordinal))
|
|
|
|
if (!string.Equals(text, newText, StringComparison.Ordinal))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var fileStream = new FileStream(file, FileMode.Create, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
|
|
|
|
var fileStream = new FileStream(file, FileMode.Create, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
|
|
|
|
var writer = new StreamWriter(fileStream, encoding);
|
|
|
|
|
|
|
|
await using (fileStream.ConfigureAwait(false))
|
|
|
|
await using (fileStream.ConfigureAwait(false))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var writer = new StreamWriter(fileStream, encoding);
|
|
|
|
await using (writer.ConfigureAwait(false))
|
|
|
|
await using (writer.ConfigureAwait(false))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await writer.WriteAsync(newText.AsMemory(), cancellationToken).ConfigureAwait(false);
|
|
|
|
await writer.WriteAsync(newText.AsMemory(), cancellationToken).ConfigureAwait(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string GetSubtitleCachePath(MediaSourceInfo mediaSource, int subtitleStreamIndex, string outputSubtitleExtension)
|
|
|
|
private string GetSubtitleCachePath(MediaSourceInfo mediaSource, int subtitleStreamIndex, string outputSubtitleExtension)
|
|
|
|
{
|
|
|
|
{
|
|
|
|