-
-
Notifications
You must be signed in to change notification settings - Fork 770
Description
This issue respects the following points:
- I have discussed this issue in the Jellyfin forum and/or troubleshooting chat before opening this issue.
- This issue is not already reported on GitHub (I've searched it).
- I agree to follow Jellyfin's Code of Conduct.
- This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one.
Describe the bug
On recorded live tv content, when you attempt to playback the show/content the playback is constantly starting/stopping in fast loop. The effect the user sees is endless flickering of the recording.
The recorded show plays back fine on an android client.
Initial Analysis
MPEG-TS containers use PID-based stream identifiers (e.g., video PID 0x91=145, audio PID 0x94=148) rather than sequential indices. The VideoManager track matching methods (getExoPlayerTrack and setExoPlayerTrack) rely on offsetStreamIndex to translate between
Jellyfin stream indices (sequential: 0, 1) and ExoPlayer track group IDs. This translation assumes group IDs are sequential, which fails for MPEG-TS PIDs:
- getExoPlayerTrack: Parses the selected audio group ID → 148, calls offsetStreamIndex(148, ...) → fails bounds check (148 > 2 streams) → returns -1
- setExoPlayerTrack: Converts Jellyfin index 1 → exoTrackID 1, tries to match against group ID 148 → no match → returns false
This triggers the following loop in PlaybackController:
- onPrepared() calls switchAudioStream(1) (the server's default audio index)
- getAudioStreamIndex() returns -1 (failed PID lookup), so -1 != 1, the early-return is skipped
- setExoPlayerTrack(1, AUDIO, ...) returns false (PID mismatch)
- The else branch calls stop() then playInternal() to rebuild the stream
- stop() calls clearPlaybackSessionOptions() which resets mCurrentStreamInfo and mDefaultAudioIndex
- playInternal() POSTs to /Sessions/Playing, restarts the player → back to step 1
Looking and searching through the code history, this MAY be related and introduced with this commit: 66573c3
Media info of the file
Media capabilities report
No response
Client logs
No response
FFmpeg logs
Application version
latest/Head
Where did you install the app from?
None
Device information
Fire Cube TV, Android Studio Emulator.
Android version
N/A
Jellyfin server version
10.10.2
Other sources
No response