From 2d97a21582ae1bffbc2939bcdc2ccd6613f28bf4 Mon Sep 17 00:00:00 2001 From: christophe Date: Mon, 14 Sep 2026 00:43:59 -0500 Subject: [PATCH] Fix NoCompatibleStream when playing an in-progress DVR recording 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. --- .../wholphin/ui/playback/PlaybackViewModel.kt | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt index 79d2ae5796..62d3eb5a9c 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt @@ -465,6 +465,23 @@ class PlaybackViewModel val isLiveTv = item.type == BaseItemKind.TV_CHANNEL val base = item.data + // A DVR recording that's still being actively written has no stable + // MediaSource id: the item's cached/static MediaSources (from a plain item + // GET, via MediaSourceManager.GetStaticMediaSources server-side) carry the + // item's own id, but the server resolves in-progress-recording playback + // dynamically (MediaSourceManager.GetRecordingStreamMediaSources) with a + // DIFFERENT id (the active recording's own id, not the item's). If we send + // that stale static id as an explicit mediaSourceId in the PlaybackInfo + // request, the server's own id-filter matches nothing and returns + // ErrorCode=NoCompatibleStream instantly -- even though a perfectly good + // source exists. Confirmed by reproducing against a live 12.0.0 server and + // reading the exact server-side filter in Jellyfin.Api.Helpers + // .MediaInfoHelper.ResolvePlaybackMediaSources. Treat this exactly like a + // live TV channel: skip static source selection and let the server resolve + // the current source itself (sourceId = null). + val isInProgressRecording = + item.type == BaseItemKind.RECORDING && base.status == "InProgress" + val skipStaticSourceSelection = isLiveTv || isInProgressRecording // Use the provided playback parameters or else check if the database has some val itemPlayback = @@ -479,7 +496,7 @@ class PlaybackViewModel } } val mediaSource = - if (!isLiveTv) { + if (!skipStaticSourceSelection) { streamChoiceService.chooseSource(base, itemPlayback) } else { null @@ -487,7 +504,7 @@ class PlaybackViewModel val plc = streamChoiceService.getPlaybackLanguageChoice(base) - if (mediaSource == null && !isLiveTv) { + if (mediaSource == null && !skipStaticSourceSelection) { showToast( context, "Item has no media sources, skipping...",