From c27aff1c6301bb62d3720e6d143c5d01412c1324 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sun, 20 Jan 2019 21:50:35 +0100 Subject: [PATCH] Fix segment_time_delta for ffmpeg 4.1 --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index b3099e17e..a488576da 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -936,10 +936,10 @@ namespace MediaBrowser.Api.Playback.Hls var timeDeltaParam = string.Empty; - if (isEncoding && startNumber > 0) + if (isEncoding && state.TargetFramerate > 0) { - var startTime = state.SegmentLength * startNumber; - timeDeltaParam = string.Format("-segment_time_delta -{0}", startTime); + float startTime = 1 / (state.TargetFramerate.Value * 2); + timeDeltaParam = string.Format("-segment_time_delta {0}", Math.Round(startTime, 3)); } var segmentFormat = GetSegmentFileExtension(state.Request).TrimStart('.');