Skip to content

Fix build reliability and improve subtitle playback performance#88

Merged
dfederm merged 1 commit into
dfederm:mainfrom
CyberoniOntoni:fix/build-and-subtitle-playback
Jun 23, 2026
Merged

Fix build reliability and improve subtitle playback performance#88
dfederm merged 1 commit into
dfederm:mainfrom
CyberoniOntoni:fix/build-and-subtitle-playback

Conversation

@CyberoniOntoni

@CyberoniOntoni CyberoniOntoni commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Improves subtitle playback performance during direct play.

Rebased onto main; build/restore changes were dropped (addressed upstream in #90 and #92).

Subtitle playback

Fixes noticeable lag/stutter when subtitles are enabled during otherwise smooth direct play.

  • Load only the selected external subtitle instead of fetching/parsing every external track up front.
  • Authenticated Jellyfin-hosted external subtitles: Download via injected IRequestAdapter.SendPrimitiveAsync and TimedTextSource.CreateFromStream; third-party URLs use CreateFromUri without appending an API key.
  • Route by DeliveryMethod: Embedded and the selected external track are presented client-side; switching to another unloaded external track restarts playback to load it.
  • Cache bitrate test for the duration of a playback session (avoids repeated 1MB download tests on track restarts).
  • Subtitle presentation: Consolidate track presentation logic and reduce TimedMetadataTracksChanged dispatcher churn.
  • Device profile init: Ensure profile is ready before playback info requests.

Test plan

  • Build succeeds locally with VS 2026 + UWP workload (Release | x64)
  • App launches and connects to Jellyfin server
  • Video direct play works with subtitles off
  • Subtitle toggle/selection plays smoothly (no severe lag) with embedded and external SRT/VTT
  • Seamless subtitle track switching still works where supported (embedded; selected external)

Notes

Tested on Windows (desktop deployment). Intended to benefit Xbox Series X/S as well.

@dfederm dfederm left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! I have a few comments, some of which are blocking.

Going fwd can you try to split logically different changes into separate PRs? It's easier to review and also permits merging some while others are still being reviewed or while comments are being addressed.

Comment thread Directory.Build.props Outdated
Comment thread Directory.Packages.props Outdated
Comment thread src/JellyBox/JellyBox.csproj Outdated
Comment thread src/JellyBox/JellyBox.csproj Outdated
Comment thread src/JellyBox/JellyBox.csproj Outdated
Comment thread src/JellyBox/ViewModels/VideoViewModel.MediaSource.cs Outdated
Comment thread src/JellyBox/ViewModels/VideoViewModel.MediaSource.cs Outdated
Comment thread src/JellyBox/ViewModels/VideoViewModel.MediaSource.cs Outdated
Comment thread src/JellyBox/ViewModels/VideoViewModel.MediaSource.cs Outdated
Comment thread src/JellyBox/ViewModels/VideoViewModel.MediaSource.cs Outdated
@CyberoniOntoni

Copy link
Copy Markdown
Contributor Author

My bad, I pushed too many changes as one PR before I realized what have I done :)
Broke it apart a little.

@dfederm dfederm left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks mostly good. Just rebase onto main and drop the build changes since they're all now moot, leaving this PR purely about subtitle fixes.

Load only the selected external subtitle via IRequestAdapter for Jellyfin-hosted tracks and CreateFromUri for third-party URLs. Route subtitle presentation by DeliveryMethod, cache bitrate per session, and ensure the device profile is initialized before playback info requests.
@CyberoniOntoni CyberoniOntoni force-pushed the fix/build-and-subtitle-playback branch from a7dfdc0 to 77bb4a1 Compare June 23, 2026 01:39
@CyberoniOntoni CyberoniOntoni requested a review from dfederm June 23, 2026 01:44
@dfederm dfederm merged commit fbd689b into dfederm:main Jun 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants