mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-31 12:14:21 -04:00
Use subtitle cache when burning-in subs
This commit is contained in:
parent
c67b78bc68
commit
7c3c0aa940
@ -1652,13 +1652,15 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
setPtsParam);
|
setPtsParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
var mediaPath = state.MediaPath ?? string.Empty;
|
var subtitlePath = _subtitleEncoder.GetSubtitleFilePath(
|
||||||
|
state.SubtitleStream,
|
||||||
|
state.MediaSource,
|
||||||
|
CancellationToken.None).GetAwaiter().GetResult();
|
||||||
|
|
||||||
return string.Format(
|
return string.Format(
|
||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
"subtitles=f='{0}':si={1}{2}{3}{4}{5}",
|
"subtitles=f='{0}'{1}{2}{3}{4}",
|
||||||
_mediaEncoder.EscapeSubtitleFilterPath(mediaPath),
|
_mediaEncoder.EscapeSubtitleFilterPath(subtitlePath),
|
||||||
state.InternalSubtitleStreamOffset.ToString(CultureInfo.InvariantCulture),
|
|
||||||
alphaParam,
|
alphaParam,
|
||||||
sub2videoParam,
|
sub2videoParam,
|
||||||
fontParam,
|
fontParam,
|
||||||
|
@ -44,5 +44,14 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
Task<string> GetSubtitleFileCharacterSet(MediaStream subtitleStream, string language, MediaSourceInfo mediaSource, CancellationToken cancellationToken);
|
Task<string> GetSubtitleFileCharacterSet(MediaStream subtitleStream, string language, MediaSourceInfo mediaSource, CancellationToken cancellationToken);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the path to a subtitle file.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="subtitleStream">The subtitle stream.</param>
|
||||||
|
/// <param name="mediaSource">The media source.</param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
|
/// <returns>System.String.</returns>
|
||||||
|
Task<string> GetSubtitleFilePath(MediaStream subtitleStream, MediaSourceInfo mediaSource, CancellationToken cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -902,6 +902,12 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<string> GetSubtitleFilePath(MediaStream subtitleStream, MediaSourceInfo mediaSource, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var info = await GetReadableFile(mediaSource, subtitleStream, cancellationToken);
|
||||||
|
return info.Path;
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user