diff options
| author | crimsonspecter <246959308+crimsonspecter@users.noreply.github.com> | 2026-03-06 16:58:07 -0500 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2026-03-06 16:58:07 -0500 |
| commit | 0ebf6a6db6dbd3d3148c8075427de0516b274537 (patch) | |
| tree | 74ee2c34b5a42779ecd157c102bce3a3feeb9245 | |
| parent | d2334a35c15ddc9141e8289f8ed5c1719cef03db (diff) | |
Fix hls segment length adjustment for remuxed content
Original-merge: 09ba04662acf256ec0a22f56de7e02d65d0805f6
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Bond_009 <bond.009@outlook.com>
| -rw-r--r-- | Jellyfin.Api/Controllers/DynamicHlsController.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs index f80b36c39..acd5dd64e 100644 --- a/Jellyfin.Api/Controllers/DynamicHlsController.cs +++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs @@ -1403,8 +1403,8 @@ public class DynamicHlsController : BaseJellyfinApiController double fps = state.TargetFramerate ?? 0.0f; int segmentLength = state.SegmentLength * 1000; - // If framerate is fractional (i.e. 23.976), we need to slightly adjust segment length - if (Math.Abs(fps - Math.Floor(fps + 0.001f)) > 0.001) + // If video is transcoded and framerate is fractional (i.e. 23.976), we need to slightly adjust segment length + if (!EncodingHelper.IsCopyCodec(state.OutputVideoCodec) && Math.Abs(fps - Math.Floor(fps + 0.001f)) > 0.001) { double nearestIntFramerate = Math.Ceiling(fps); segmentLength = (int)Math.Ceiling(segmentLength * (nearestIntFramerate / fps)); |
