[PR #16079] [CLOSED] Fix: Sync HLS playlist sequence with FFmpeg segment numbers #14514

Closed
opened 2026-02-07 07:31:02 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/16079
Author: @ZeusCraft10
Created: 1/21/2026
Status: Closed

Base: masterHead: fix/hls-seek-infinite-buffering


📝 Commits (1)

  • 72eb47c Fix: Sync HLS playlist sequence with FFmpeg segment numbers to prevent buffering on seek

📊 Changes

5 files changed (+51 additions, -4 deletions)

View changed files

📝 Jellyfin.Api/Controllers/DynamicHlsController.cs (+14 -1)
📝 src/Jellyfin.MediaEncoding.Hls/Playlist/CreateMainPlaylistRequest.cs (+8 -1)
📝 src/Jellyfin.MediaEncoding.Hls/Playlist/DynamicHlsPlaylistGenerator.cs (+2 -2)
📝 tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj (+1 -0)
📝 tests/Jellyfin.MediaEncoding.Hls.Tests/Playlist/DynamicHlsPlaylistGeneratorTests.cs (+26 -0)

📄 Description

Hey team, I finally cracked that nasty HLS infinite buffering bug we've been seeing with Dolby Vision content! 🐛

The root cause was pretty tricky: when you seek, FFmpeg restarts and creates segment files starting from a new index (like 1187.mp4), but our server was still generating playlists starting at 0.mp4. The client would ask for segment 0, get a 404, and just spin forever.

This PR fixes it by:

  1. Checking for existing segment files on disk when generating the playlist.
  2. Using that file's index as the starting point for the playlist sequence.

Now the playlist URLs match the actual files on disk, so playback resumes instantly after seeking. 🚀

I've added a unit test to cover this case. Let me know what you think!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/16079 **Author:** [@ZeusCraft10](https://github.com/ZeusCraft10) **Created:** 1/21/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/hls-seek-infinite-buffering` --- ### 📝 Commits (1) - [`72eb47c`](https://github.com/jellyfin/jellyfin/commit/72eb47c881bc9f89e0f598c822b8f9758b878922) Fix: Sync HLS playlist sequence with FFmpeg segment numbers to prevent buffering on seek ### 📊 Changes **5 files changed** (+51 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `Jellyfin.Api/Controllers/DynamicHlsController.cs` (+14 -1) 📝 `src/Jellyfin.MediaEncoding.Hls/Playlist/CreateMainPlaylistRequest.cs` (+8 -1) 📝 `src/Jellyfin.MediaEncoding.Hls/Playlist/DynamicHlsPlaylistGenerator.cs` (+2 -2) 📝 `tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj` (+1 -0) 📝 `tests/Jellyfin.MediaEncoding.Hls.Tests/Playlist/DynamicHlsPlaylistGeneratorTests.cs` (+26 -0) </details> ### 📄 Description Hey team, I finally cracked that nasty HLS infinite buffering bug we've been seeing with Dolby Vision content! 🐛 The root cause was pretty tricky: when you seek, FFmpeg restarts and creates segment files starting from a new index (like 1187.mp4), but our server was still generating playlists starting at 0.mp4. The client would ask for segment 0, get a 404, and just spin forever. This PR fixes it by: 1. Checking for existing segment files on disk when generating the playlist. 2. Using that file's index as the starting point for the playlist sequence. Now the playlist URLs match the actual files on disk, so playback resumes instantly after seeking. 🚀 I've added a unit test to cover this case. Let me know what you think! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:31:02 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14514