Repository navigation
Fix NoCompatibleStream when playing a fresh in-progress DVR recording - #1968
Open
mackandall wants to merge 1 commit into
Open
mackandall wants to merge 1 commit into
mackandall wants to merge 1 commit into
Conversation
Root cause (confirmed against a live 12.0.0 server, both client and server source read): playback for a Recording item picks a MediaSourceInfo from the item's cached/static MediaSources list (fetched by a plain item GET, server-side MediaSourceManager.GetStaticMediaSources -- Id = the item's own guid), then sends that Id as an explicit mediaSourceId in the PlaybackInfo request. For a recording that's still actively being written, that Id is wrong: MediaSourceManager.GetRecordingStreamMediaSources builds the real, dynamically-resolved source with Id = the active recording's own id, which is never the item's guid. Jellyfin.Api.Helpers .MediaInfoHelper.ResolvePlaybackMediaSources filters the server's sources by the requested mediaSourceId, matches nothing, and the PlaybackInfo response comes back with ErrorCode=NoCompatibleStream -- fast (no probing, no I/O), and PlaybackViewModel.changeStreams silently bails out and navigates back with no user-facing error at all. Reproduced with a fresh (never-before-played) in-progress recording; a previously-played one can still work if its stored itemPlayback source coincidentally still matches. Fix: treat an in-progress recording (BaseItemKind.RECORDING with status == "InProgress") the same way TV_CHANNEL already is --skip static source selection entirely and pass sourceId = null, letting the server resolve the current source itself. Verified against the same recording on-device: PlaybackInfo now returns a real Transcode decision instead of NoCompatibleStream.
Owner
|
Thanks for submitting this PR. Please fix the PR description to match the template provided when opening a pull request. Additionally, please review the AI/LLM policy again. |
Author
|
Apologies. Will fix with human language and resubmit. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pressing Play on a DVR recording that's still actively being written does nothing — no error, no toast — if that particular recording has never been played before. Logcat shows:
...after which the app just navigates back to the series page with no indication anything went wrong.
Root cause
play()only treatsBaseItemKind.TV_CHANNELas needing no explicitmediaSourceId. ARecordingitem goes throughstreamChoiceService.chooseSource(base, itemPlayback), which picks from the item's cachedMediaSources(from a plain itemGET) — whoseIdis the item's own guid (MediaSourceManager.GetStaticMediaSourcesserver-side). That id gets sent as an explicitmediaSourceIdin thePlaybackInforequest.But for an actively recording item, the server resolves the real source dynamically via
MediaSourceManager.GetRecordingStreamMediaSources, whoseIdis the active recording's own id — never the item's guid. The server'sMediaInfoHelper.ResolvePlaybackMediaSourcesfilters by the requestedmediaSourceId, finds nothing, and returnsErrorCode: NoCompatibleStream.This only reproduces on a fresh first-ever play attempt for a given in-progress recording — a previously-played one can take a different path and work fine, which is probably why it hadn't surfaced before.
Fix
Treat an in-progress recording (
item.type == BaseItemKind.RECORDING && dto.status == "InProgress") the same as a live TV channel inplay()— skip static source selection, passsourceId = null, let the server resolve fresh.Verified on-device against two independent fresh in-progress recordings on two different shows/channels: before the fix, instant
NoCompatibleStream; after, a normalTranscodeplayback decision and the video plays immediately.Separate observation (not addressed by this PR)
Even without this specific root cause,
changeStreamssilently swallowsresponse.errorCodeinstead of surfacing it to the user (a toast/snackbar) — worth considering separately, since any futureNoCompatibleStreamcase will otherwise look like "nothing happens" again.