From 63e16a4d99ff8d97a16d0fe9e0edd860ce6f0815 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 23 Mar 2013 23:56:01 -0400 Subject: [PATCH] #80 - Subtitle Paramaters For HLS --- MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 2 +- MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 9112ee3553..b2ce1ab8a9 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -171,7 +171,7 @@ namespace MediaBrowser.Api.Playback.Hls segmentOutputPath = Path.Combine(segmentOutputPath, segmentOutputName + "%03d." + GetSegmentFileExtension(state).TrimStart('.')); var probeSize = Kernel.Instance.FFMpegManager.GetProbeSizeArgument(state.Item); - + return string.Format("{0} {1} -i {2}{3} -threads 0 {4} {5} {6} -force_key_frames expr:gte(t,n_forced*5) -f ssegment -segment_list_flags +live -segment_time 10 -segment_list \"{7}\" \"{8}\"", probeSize, GetFastSeekCommandLineParameter(state.Request), diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index dfcc3a2c59..5ef70c8109 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -151,8 +151,16 @@ namespace MediaBrowser.Api.Playback.Hls args += string.Format(" -g {0}", framerate); args += " -vsync vfr"; - - + + if (state.SubtitleStream != null) + { + // This is for internal graphical subs + if (!state.SubtitleStream.IsExternal && (state.SubtitleStream.Codec.IndexOf("pgs", StringComparison.OrdinalIgnoreCase) != -1 || state.SubtitleStream.Codec.IndexOf("dvd", StringComparison.OrdinalIgnoreCase) != -1)) + { + args += GetInternalGraphicalSubtitleParam(state, codec); + } + } + return args; }