mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-03 19:17:24 -05:00 
			
		
		
		
	Merge pull request #12627 from oxixes/burn-subtitle-cache
This commit is contained in:
		
						commit
						e6ceab46a4
					
				@ -189,6 +189,8 @@
 | 
			
		||||
 - [TheMelmacian](https://github.com/TheMelmacian)
 | 
			
		||||
 - [ItsAllAboutTheCode](https://github.com/ItsAllAboutTheCode)
 | 
			
		||||
 - [pret0rian8](https://github.com/pret0rian)
 | 
			
		||||
 - [jaina heartles](https://github.com/heartles)
 | 
			
		||||
 - [oxixes](https://github.com/oxixes)
 | 
			
		||||
 | 
			
		||||
# Emby Contributors
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1652,13 +1652,15 @@ namespace MediaBrowser.Controller.MediaEncoding
 | 
			
		||||
                    setPtsParam);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            var mediaPath = state.MediaPath ?? string.Empty;
 | 
			
		||||
            var subtitlePath = _subtitleEncoder.GetSubtitleFilePath(
 | 
			
		||||
                    state.SubtitleStream,
 | 
			
		||||
                    state.MediaSource,
 | 
			
		||||
                    CancellationToken.None).GetAwaiter().GetResult();
 | 
			
		||||
 | 
			
		||||
            return string.Format(
 | 
			
		||||
                CultureInfo.InvariantCulture,
 | 
			
		||||
                "subtitles=f='{0}':si={1}{2}{3}{4}{5}",
 | 
			
		||||
                _mediaEncoder.EscapeSubtitleFilterPath(mediaPath),
 | 
			
		||||
                state.InternalSubtitleStreamOffset.ToString(CultureInfo.InvariantCulture),
 | 
			
		||||
                "subtitles=f='{0}'{1}{2}{3}{4}",
 | 
			
		||||
                _mediaEncoder.EscapeSubtitleFilterPath(subtitlePath),
 | 
			
		||||
                alphaParam,
 | 
			
		||||
                sub2videoParam,
 | 
			
		||||
                fontParam,
 | 
			
		||||
 | 
			
		||||
@ -44,5 +44,14 @@ namespace MediaBrowser.Controller.MediaEncoding
 | 
			
		||||
        /// <param name="cancellationToken">The cancellation token.</param>
 | 
			
		||||
        /// <returns>System.String.</returns>
 | 
			
		||||
        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,13 @@ namespace MediaBrowser.MediaEncoding.Subtitles
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public async Task<string> GetSubtitleFilePath(MediaStream subtitleStream, MediaSourceInfo mediaSource, CancellationToken cancellationToken)
 | 
			
		||||
        {
 | 
			
		||||
            var info = await GetReadableFile(mediaSource, subtitleStream, cancellationToken)
 | 
			
		||||
                .ConfigureAwait(false);
 | 
			
		||||
            return info.Path;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <inheritdoc />
 | 
			
		||||
        public void Dispose()
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user