Repository navigation
[WIP] Replace MPV with Media3 playback protocol v3 - #67
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR migrates Android video playback to a single Media3 runtime with protocol-v3 server planning and replanning. It removes MPV execution paths, adds authentication, capability, Dolby Vision, libass, seek, recovery, deep-link, and validation infrastructure, and updates documentation and build tooling. ChangesMedia3-only playback migration
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code reviewFound 1 issue:
Lines 4 to 6 in 2f71bfc 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
There was a problem hiding this comment.
Actionable comments posted: 11
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptor.kt (1)
36-62: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winBound the media refresh call, not the snapshot reads
authSession.snapshot()is just mutex-protected state access, butrefreshIfStale()still runs a realOkHttprefresh on the interceptor thread. The injectedplayer-refresh-okhttpclient is a plainOkHttpClient()inPlayerModule, so a slow or hung refresh can stall playback 401 handling. Give the refresh client an explicit timeout budget, or move the refresh off the interceptor thread.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptor.kt` around lines 36 - 62, Bound the refresh operation used by MediaAuthInterceptor without adding timeouts to the mutex-protected snapshot reads. Configure the injected player-refresh-okhttp client in PlayerModule with explicit connect, read, and call timeouts, or move refreshIfStale off the interceptor thread while preserving its single-flight behavior and retry flow.
🧹 Nitpick comments (13)
shared/src/commonMain/kotlin/org/siloserver/silo/repository/PlaybackRepository.kt (1)
21-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd KDoc to the new V3 methods for consistency.
Every other public method in this class (
startPlayback,updateProgress,stopPlayback,startTranscode) has a doc comment; the newstartPlaybackV3/replanPlaybackV3/reportRouteEventV3methods don't.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shared/src/commonMain/kotlin/org/siloserver/silo/repository/PlaybackRepository.kt` around lines 21 - 30, Add KDoc comments to the public methods startPlaybackV3, replanPlaybackV3, and reportRouteEventV3 in PlaybackRepository, matching the existing documentation style used by startPlayback, updateProgress, stopPlayback, and startTranscode. Document each method’s purpose and parameters without changing their behavior.android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/audio/PassthroughSuppressionRegistryTest.kt (1)
27-36: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winText-matching the production source instead of testing behavior.
This test reads a sibling
.ktfile via a hardcoded relative path and substring-matches its contents, rather than exercisingAudioSink/renderer behavior. It's fragile to source reformatting and to the test's working directory, and it can pass even if the actual runtime behavior regresses (as long as the token strings remain present).Consider replacing this with a behavioral test that constructs/mocks an
AudioSink(or the renderer that wraps it) and asserts the actualSINK_FORMAT_*value returned whenPassthroughSuppressionRegistry.isSuppressed(format)is true.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/audio/PassthroughSuppressionRegistryTest.kt` around lines 27 - 36, The test suppressingSinkMarksEncodedFormatUnsupportedToForcePcmDecode currently inspects production source text instead of runtime behavior. Replace the hardcoded file reading and substring assertions with a behavioral test that exercises the relevant AudioSink or renderer path using a suppressed format, then assert it returns AudioSink.SINK_FORMAT_UNSUPPORTED and not SINK_FORMAT_SUPPORTED_WITH_TRANSCODING.android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudioCapabilityManager.kt (2)
138-147: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated codec/min-SDK gating between
mapCapabilitiesandprobePassthroughEntries.The
(codec name, encoding, minSdk)mapping fordts_hd,truehd, andac4is written out twice — once to buildcodecs, once inencodingsToProbe. A future SDK-guard change applied to only one site would silently desync the two lists.Consider extracting a single
data class EncodingSupport(val codec: String, val encoding: Int, val minSdk: Int)list used by bothcodecsconstruction andencodingsToProbe.Also applies to: 242-253
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudioCapabilityManager.kt` around lines 138 - 147, Extract the shared codec, encoding, and minimum-SDK metadata for dts_hd, truehd, and ac4 into a single EncodingSupport data class/list. Update both mapCapabilities and probePassthroughEntries to derive codecs and encodingsToProbe from that shared list while preserving the existing SDK guards and outputs.
150-158: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winFallback to
2on Q+ can under-report real channel capacity.Pre-Q falls back to
caps.maxChannelCount.coerceAtLeast(2)when direct probing is unavailable, but on Q+ an emptyentrieslist (e.g., because none of the 3 fixed candidate layouts matched a codec the sink genuinely supports at a different channel count) silently collapsesmaxChannelsto2. This can under-report passthrough capability to the server and degrade the selected route even thoughcaps.maxChannelCountmay still carry a useful signal.♻️ Proposed fix: keep the Media3 value as a floor instead of a hardcoded 2
val maxChannels = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - entries.flatMap(AudioPassthroughEntry::channelCounts).maxOrNull() ?: 2 + entries.flatMap(AudioPassthroughEntry::channelCounts).maxOrNull() + ?: caps.maxChannelCount.coerceAtLeast(2) } else { caps.maxChannelCount.coerceAtLeast(2) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudioCapabilityManager.kt` around lines 150 - 158, Update the Q+ fallback in the maxChannels calculation near probePassthroughEntries so an empty entries result uses caps.maxChannelCount.coerceAtLeast(2), matching the pre-Q behavior, rather than defaulting directly to 2. Preserve the probed channel maximum when entries are available.shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.kt (1)
79-98: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueDescriptor doesn't reflect the serializer's nullable type parameter.
TolerantPlaybackPlanV3SerializerimplementsKSerializer<PlaybackPlanV3?>but exposesdelegate.descriptor(non-nullable) rather thandelegate.descriptor.nullable. Actual serialize/deserialize already handle null explicitly, so JSON round-tripping is unaffected, but the descriptor'sisNullablemetadata is technically inconsistent with the serializer's declared nullable type — worth aligning for correctness with formats/tools that inspect the descriptor.♻️ Suggested fix
internal object TolerantPlaybackPlanV3Serializer : KSerializer<PlaybackPlanV3?> { private val delegate = PlaybackPlanV3.serializer() - override val descriptor: SerialDescriptor = delegate.descriptor + override val descriptor: SerialDescriptor = delegate.descriptor.nullable🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.kt` around lines 79 - 98, Update TolerantPlaybackPlanV3Serializer.descriptor to expose the delegate descriptor as nullable, matching its KSerializer<PlaybackPlanV3?> type and the existing null handling in serialize and deserialize.android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AuthenticatedDataSourceFactory.kt (1)
181-198: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win
requestHeadersProviderinvoked for every scheme, including local file/content URIs.Headers are computed and potentially merged into the
DataSpeceven when the resolved URI routes tofile/contentdownstream sources that never readhttpRequestHeaders. Scoping the call to http(s) schemes avoids unnecessary provider invocations and stray header injection on local playback paths.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AuthenticatedDataSourceFactory.kt` around lines 181 - 198, Update resolveDataSpec to invoke requestHeadersProvider only when resolved.uri uses an HTTP or HTTPS scheme. Return the resolved DataSpec unchanged for file, content, and other non-network schemes, while preserving the existing header merge behavior for HTTP(S) URIs.libass-bridge/build.gradle.kts (1)
30-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse version catalog for JUnit like the other dependencies.
Every other dependency here resolves through
libs.*; hardcoding"junit:junit:4.13.2"breaks that consistency and bypasses centralized version management.♻️ Suggested fix
- testImplementation("junit:junit:4.13.2") + testImplementation(libs.junit)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@libass-bridge/build.gradle.kts` at line 30, Update the test dependency declaration in the Gradle configuration to use the existing version-catalog JUnit alias via libs.* instead of the hardcoded junit:junit:4.13.2 coordinate, matching the style of the surrounding dependencies.androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreenStartPositionTest.kt (1)
125-129: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winUnscoped substring checks don't actually verify "watchdog re-arm on transport reopen."
Unlike the sibling test above it (which scopes assertions to
mountEffectviasubstringAfter/substringBefore), this test only checks that two literal strings exist anywhere inTvPlayerScreen.kt. It would pass even if the two snippets are unrelated and never used together to rearm anything, so it doesn't meaningfully guard the described behavior.♻️ Scope the check like the neighboring test
`@Test` fun transportReopenRearmsSharedWatchdog() { - assertTrue(source.contains("state.playbackPlan?.decisionTrace?.size")) - assertTrue(source.contains("plan?.decisionTrace?.size ?: 0")) + val transportReopenBlock = source + .substringAfter("/* transport reopen */") // or the actual marker/function name + .substringBefore("/* end transport reopen */") + assertTrue(transportReopenBlock.contains("state.playbackPlan?.decisionTrace?.size")) + assertTrue(transportReopenBlock.contains("plan?.decisionTrace?.size ?: 0")) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreenStartPositionTest.kt` around lines 125 - 129, Update transportReopenRearmsSharedWatchdog to scope its source assertions to the relevant transport-reopen/watchdog block, following the neighboring test’s substringAfter/substringBefore pattern. Verify both decisionTrace expressions occur within that scoped block and remain part of the same re-arm logic, rather than matching anywhere in TvPlayerScreen.kt.android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackV3Session.kt (1)
86-89: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winPrefer exhaustive
whenover.namestring comparison forstream.protocol.Line 87 compares
stream.protocol.nameto the literal"HLS"instead of matching the enum value directly. Unlike thePlaybackDeliverymapping just above (Lines 41-48), which the compiler forces to stay exhaustive, this string comparison silently classifies any future/unhandledPlaybackStreamProtocolvalue as"progressive"without any compile-time warning.♻️ Suggested fix
- stream = PlaybackStreamRequest( - url = stream.url, - streamType = if (stream.protocol.name == "HLS") "hls" else "progressive", - playMethod = playMethod, - ), + stream = PlaybackStreamRequest( + url = stream.url, + streamType = when (stream.protocol) { + PlaybackStreamProtocol.HLS -> "hls" + PlaybackStreamProtocol.HTTP_PROGRESSIVE -> "progressive" + }, + playMethod = playMethod, + ),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackV3Session.kt` around lines 86 - 89, Replace the streamType conditional in the PlaybackV3Session playback request with an exhaustive when over stream.protocol, mapping the HLS enum value to "hls" and explicitly mapping the remaining supported protocol value to "progressive". Avoid comparing protocol.name so future enum values trigger compile-time handling.shared/src/commonTest/kotlin/org/siloserver/silo/network/api/PlaybackApiTest.kt (1)
122-122: 📐 Maintainability & Code Quality | 🔵 TrivialPrefer
jsonPrimitive.booleanover manualcontent.toBoolean().
kotlinx-serialization-jsonprovidesJsonPrimitive.booleanfor this exact conversion, matching the.intusage already used elsewhere in this test.
[optional_refactor_low_effort]♻️ Proposed fix
- assertEquals(true, body["metered"]!!.jsonPrimitive.content.toBoolean()) + assertEquals(true, body["metered"]!!.jsonPrimitive.boolean)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shared/src/commonTest/kotlin/org/siloserver/silo/network/api/PlaybackApiTest.kt` at line 122, Update the metered assertion in PlaybackApiTest to use JsonPrimitive.boolean instead of manually converting jsonPrimitive.content with toBoolean(), matching the existing JsonPrimitive.int style used elsewhere in the test.android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackBufferPolicyTest.kt (1)
52-60: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueTest name vs. new assertion direction may be inconsistent.
The assertion flipped from a "less than" to a "greater than or equal to" check against
Balanced.bufferForPlaybackMs, and with the new constants (Smooth=5000ms > Balanced=3000ms) SmoothPlayback now requires more initial buffering than Balanced before playback starts — the opposite of what...StartsQuickly...implies relative to Balanced. Please confirm this retune (favoring fewer rebuffers over startup speed) is intentional, and consider renaming the test if so.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackBufferPolicyTest.kt` around lines 52 - 60, Confirm the SmoothPlayback tuning in smoothPlaybackStartsQuicklyThenGrowsADeepForwardBuffer: if its initial buffer is intentionally greater than Balanced’s, rename the test to describe deeper buffering and rebuffers rather than quick startup; otherwise restore the assertion and constants so SmoothPlayback starts with less buffering than Balanced.android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptor.kt (1)
27-34: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winAvoid a default throwaway
OkHttpClient()for refresh.Each
OkHttpClient()instance owns its own dispatcher/connection pool. If this secondary constructor is invoked more than once (e.g. per player session), it needlessly multiplies thread pools. Prefer requiring callers to pass a shared client instance.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptor.kt` around lines 27 - 34, Remove the default OkHttpClient() value from the secondary MediaAuthInterceptor constructor and require callers to provide a shared refreshClient explicitly. Keep the existing MediaAuthSession wiring and other constructor defaults unchanged.android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthSession.kt (1)
24-27: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winAvoid a fresh
OkHttpClient()per default parameter.The default value
OkHttpClient()allocates a new client (its own dispatcher/connection pool) whenever this constructor is invoked without an explicitrefreshClient. Prefer wiring the app-wide sharedOkHttpClientinstance (already used elsewhere perPlayerOkHttpClient.kt) so refresh requests reuse the existing connection pool instead of spinning up a parallel one.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthSession.kt` around lines 24 - 27, The MediaAuthSession constructor currently creates a separate OkHttpClient when refreshClient is omitted. Replace that default with the app-wide shared client used by PlayerOkHttpClient.kt, while preserving the ability to inject an explicit refreshClient.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.gitignore:
- Line 57: Remove the blanket docs/ entry from .gitignore so documentation under
docs/playback/ and docs/superpowers/ is tracked normally, including future
additions and changes.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AuthenticatedDataSourceFactory.kt`:
- Around line 71-86: Update AuthenticatedDataSourceFactory.open so the 401
handling bounds the synchronous authSession.refreshIfStale call with the
established local timeout mechanism before creating and opening the retry data
source. Preserve the existing retry behavior when refresh completes
successfully, and rethrow the original InvalidResponseCodeException when refresh
times out or fails.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackCapabilityDetector.kt`:
- Around line 404-407: The isDirectPlayableDolbyVisionProfile function must
restore Profile 8 fallback behavior: return true when the profile is 8 and the
device supports the HDR10/HLG base layer, even if dolbyVisionProfiles excludes
it. Preserve the existing Dolby Vision profile check for all other profiles and
reuse the existing base-layer capability symbols.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackNetworkMonitor.kt`:
- Around line 75-79: Synchronize the `onBandwidthSample` method using the same
monitor lock as `refresh` so validation, `measuredBitrateBps` assignment, and
`publish` execute atomically with network switching. Preserve the existing input
guards and publication behavior while preventing a stale sample from being
applied after `refresh` clears the estimate.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt`:
- Around line 67-69: Unify synchronization for activeVideoAttempt by using
videoAttemptMutex for every read and write across startVideoSessionV3,
stopSession, replanActiveVideoSession, and the reporter methods such as
reportFirstVideoFrame; remove or avoid the separate `@Synchronized` protection so
all accesses coordinate through the same guard and stale reporter updates cannot
overwrite newer state.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlayerStatsSnapshot.kt`:
- Around line 56-57: Update the videoWidth and videoHeight assignments in the
PlayerStatsSnapshot copy flow to retain current.videoWidth and
current.videoHeight when the incoming format dimensions are not positive.
Preserve the new positive dimensions while matching the existing fallback
behavior used by resolution and the other diagnostic fields.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SubtitleManager.kt`:
- Around line 742-761: Update subtitleCodecFamily so SubRip detection also
recognizes normalized values ending with “srt”, while preserving the existing
subrip match and all other codec-family branches.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetector.kt`:
- Around line 107-119: Update the progress handling in
PlaybackStartupStallDetector so bufferedPositionMs growth refreshes
lastProgressAtMs only before firstFrameRendered, not after playback has started.
For the post-first-frame path, refresh the heartbeat solely from actual
decoder/render output progress, while preserving backward-buffer handling and
the existing startup transport-progress behavior.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PostResumeVideoStallDetector.kt`:
- Around line 46-62: Update PostResumeVideoStallDetector.onIsPlayingChanged so
pausing during any active recovery stage resets or re-anchors stageStartedAtMs
and baselinePositionMs when playback resumes, preventing paused time from
contributing to stall detection. Preserve the existing pausedAfterFirstFrame
behavior for Stage.IDLE and ensure resumed recovery continues from the current
playback position and timestamp.
In `@scripts/check-no-mpv-runtime.sh`:
- Around line 7-15: Add shared/src/commonMain to the ripgrep runtime scan in the
script’s runtime_hits command, while preserving the existing exclusion filter
for PlaybackModels.kt and PlaybackProtocolV3.kt so those known references remain
ignored.
In
`@shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.kt`:
- Around line 376-389: Update the unsupported runtime-correction branch in the
playback validation flow to include the rejected correction’s identifier in the
ReplanRequired reason, matching the diagnostic detail provided by the sibling
unsupportedClientTransform branch. Use the existing unsupportedRuntimeCorrection
value when constructing the reason and preserve the current plan and
resolvedSessionId arguments.
---
Outside diff comments:
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptor.kt`:
- Around line 36-62: Bound the refresh operation used by MediaAuthInterceptor
without adding timeouts to the mutex-protected snapshot reads. Configure the
injected player-refresh-okhttp client in PlayerModule with explicit connect,
read, and call timeouts, or move refreshIfStale off the interceptor thread while
preserving its single-flight behavior and retry flow.
---
Nitpick comments:
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudioCapabilityManager.kt`:
- Around line 138-147: Extract the shared codec, encoding, and minimum-SDK
metadata for dts_hd, truehd, and ac4 into a single EncodingSupport data
class/list. Update both mapCapabilities and probePassthroughEntries to derive
codecs and encodingsToProbe from that shared list while preserving the existing
SDK guards and outputs.
- Around line 150-158: Update the Q+ fallback in the maxChannels calculation
near probePassthroughEntries so an empty entries result uses
caps.maxChannelCount.coerceAtLeast(2), matching the pre-Q behavior, rather than
defaulting directly to 2. Preserve the probed channel maximum when entries are
available.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AuthenticatedDataSourceFactory.kt`:
- Around line 181-198: Update resolveDataSpec to invoke requestHeadersProvider
only when resolved.uri uses an HTTP or HTTPS scheme. Return the resolved
DataSpec unchanged for file, content, and other non-network schemes, while
preserving the existing header merge behavior for HTTP(S) URIs.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptor.kt`:
- Around line 27-34: Remove the default OkHttpClient() value from the secondary
MediaAuthInterceptor constructor and require callers to provide a shared
refreshClient explicitly. Keep the existing MediaAuthSession wiring and other
constructor defaults unchanged.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthSession.kt`:
- Around line 24-27: The MediaAuthSession constructor currently creates a
separate OkHttpClient when refreshClient is omitted. Replace that default with
the app-wide shared client used by PlayerOkHttpClient.kt, while preserving the
ability to inject an explicit refreshClient.
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackV3Session.kt`:
- Around line 86-89: Replace the streamType conditional in the PlaybackV3Session
playback request with an exhaustive when over stream.protocol, mapping the HLS
enum value to "hls" and explicitly mapping the remaining supported protocol
value to "progressive". Avoid comparing protocol.name so future enum values
trigger compile-time handling.
In
`@android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/audio/PassthroughSuppressionRegistryTest.kt`:
- Around line 27-36: The test
suppressingSinkMarksEncodedFormatUnsupportedToForcePcmDecode currently inspects
production source text instead of runtime behavior. Replace the hardcoded file
reading and substring assertions with a behavioral test that exercises the
relevant AudioSink or renderer path using a suppressed format, then assert it
returns AudioSink.SINK_FORMAT_UNSUPPORTED and not
SINK_FORMAT_SUPPORTED_WITH_TRANSCODING.
In
`@android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackBufferPolicyTest.kt`:
- Around line 52-60: Confirm the SmoothPlayback tuning in
smoothPlaybackStartsQuicklyThenGrowsADeepForwardBuffer: if its initial buffer is
intentionally greater than Balanced’s, rename the test to describe deeper
buffering and rebuffers rather than quick startup; otherwise restore the
assertion and constants so SmoothPlayback starts with less buffering than
Balanced.
In
`@androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreenStartPositionTest.kt`:
- Around line 125-129: Update transportReopenRearmsSharedWatchdog to scope its
source assertions to the relevant transport-reopen/watchdog block, following the
neighboring test’s substringAfter/substringBefore pattern. Verify both
decisionTrace expressions occur within that scoped block and remain part of the
same re-arm logic, rather than matching anywhere in TvPlayerScreen.kt.
In `@libass-bridge/build.gradle.kts`:
- Line 30: Update the test dependency declaration in the Gradle configuration to
use the existing version-catalog JUnit alias via libs.* instead of the hardcoded
junit:junit:4.13.2 coordinate, matching the style of the surrounding
dependencies.
In
`@shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.kt`:
- Around line 79-98: Update TolerantPlaybackPlanV3Serializer.descriptor to
expose the delegate descriptor as nullable, matching its
KSerializer<PlaybackPlanV3?> type and the existing null handling in serialize
and deserialize.
In
`@shared/src/commonMain/kotlin/org/siloserver/silo/repository/PlaybackRepository.kt`:
- Around line 21-30: Add KDoc comments to the public methods startPlaybackV3,
replanPlaybackV3, and reportRouteEventV3 in PlaybackRepository, matching the
existing documentation style used by startPlayback, updateProgress,
stopPlayback, and startTranscode. Document each method’s purpose and parameters
without changing their behavior.
In
`@shared/src/commonTest/kotlin/org/siloserver/silo/network/api/PlaybackApiTest.kt`:
- Line 122: Update the metered assertion in PlaybackApiTest to use
JsonPrimitive.boolean instead of manually converting jsonPrimitive.content with
toBoolean(), matching the existing JsonPrimitive.int style used elsewhere in the
test.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fae5f4cf-9875-42af-93f3-0f87b08655c7
📒 Files selected for processing (184)
.gitignoreFEATURES.mdREADME.mdTHIRD_PARTY_NOTICES.mdandroid-shared/build.gradle.ktsandroid-shared/libs/media3-decoder-ffmpeg-1.10.0.aarandroid-shared/libs/media3-decoder-ffmpeg-1.10.1.aarandroid-shared/libs/silo-dovi-bridge-2.3.1.aarandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/di/PlayerInfraModule.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/di/PlayerModule.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/ActivePlayerHolder.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudioCapabilityManager.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AuthenticatedDataSourceFactory.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/DolbyVisionColorInfoExtractorsFactory.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/DolbyVisionProfile7Transformer.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/FfmpegAudioSupport.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptor.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthSession.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaCodecCapabilitiesProbe.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/Playability.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackAnalyticsListener.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackBufferPolicy.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackCapabilityDetector.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackNetworkMonitor.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackRecoveryPlanner.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionLifecycle.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackV3Session.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlayerOkHttpClient.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlayerStatsSnapshot.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SiloLoadControl.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SiloPlaybackService.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SiloPlayerFactory.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SubtitleManager.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/VideoPlayerMediaMounter.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/VideoPlayerMediaSpec.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/audio/PassthroughSuppressionRegistry.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/MpvDeviceFloor.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/MpvVideoPlaybackBackend.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/PlaybackBackendFallback.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineCommand.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineDecision.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoBackendCapabilities.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackend.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendFactory.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendKind.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendPreference.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendRequest.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendSelector.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackFormFactor.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/mpv/MpvPlayer.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/mpv/MpvSubtitleStyle.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/mpv/MpvTrackType.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/mpv/MpvVideoScaleMode.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/route/PlaybackRoute.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/route/RouteCapabilityMatrix.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/subtitle/OffsetSubtitleParserFactory.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/DolbyVisionHdr10PlusSanitizer.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/ImmediateServerFallbackPolicy.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/MpvSoftwareVideoCodecs.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/OriginalPlaybackRequestPolicy.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackContainerPolicy.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackRuntimeCorrectionState.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetector.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PostResumeVideoStallDetector.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/SiloMediaCodecVideoRenderer.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlaybackSessionCoordinator.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlaybackStartRequest.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlaybackStartResult.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlayerRouteArgs.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlayerUiState.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/DolbyVisionColorInfoExtractorsFactoryTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/DolbyVisionProfile7TransformerTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/FfmpegClasspathTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/Media3OnlyRuntimeSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/MediaAuthSessionTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/MediaCodecCapabilitiesProbeTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackBufferPolicyTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackCapabilityDetectorDolbyVisionTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackCapabilityDetectorSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackRecoveryPlannerTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackV3SessionTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlayerStatsSnapshotReducerTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SiloPlaybackServiceEngineSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SiloPlaybackServiceMpvSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SiloPlaybackServiceSubtitleSyncSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SiloPlayerFactoryMpvAuthSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SiloPlayerFactorySubtitleParserTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/StyledSubtitleBurnInTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SubtitleManagerTrackSelectionTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/audio/PassthroughSuppressionRegistryTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/MpvDeviceFloorTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/MpvSoftwareVideoCodecPolicyTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/MpvVideoPlaybackBackendSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/PlaybackBackendFallbackTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineCommandTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineDecisionTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/VideoBackendCapabilitiesBrandingTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/VideoBackendCapabilitiesTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendFactorySourceTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendSelectorTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/mpv/MpvPlayerSourceTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/mpv/MpvSubtitleStyleTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/route/RouteCapabilityMatrixTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/DolbyVisionHdr10PlusSanitizerTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/OriginalPlaybackRequestPolicyTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/PlaybackContainerPolicyTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/PlaybackRuntimeCorrectionStateTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetectorTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/PostResumeVideoStallDetectorTest.ktandroid-shared/src/native/dovi/THIRD_PARTY_NOTICES.txtandroid-shared/src/native/dovi/silo_dovi.cppandroidApp/build.gradle.ktsandroidApp/src/androidMain/AndroidManifest.xmlandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/di/AndroidModule.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/AppNavigation.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/ContentDeepLinkRoutes.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/Routes.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleAutoSelection.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileVideoPlaybackStarter.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerOverlay.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerSettingsSheet.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/TracksSheet.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/AndroidManifestPolicyTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/pip/MobilePictureInPictureSourceTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/player/AndroidMpvManifestSourceTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/navigation/ContentDeepLinkRoutesTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/navigation/PlayerRouteTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleAutoSelectionTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreenStartPositionTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModelSharedCoordinatorTest.ktandroidTvApp/src/androidMain/AndroidManifest.xmlandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/di/AndroidTvModule.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/navigation/TvAppNavigation.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/navigation/TvAudiobookRouting.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/navigation/TvRoute.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerHud.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.ktandroidTvApp/src/androidMain/res/layout/tv_player_view.xmlandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/TvAndroidManifestPolicyTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/player/AndroidTvMpvManifestSourceTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/navigation/TvAudiobookRoutingTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/PlayerTrackEntriesTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerControlsUsabilityTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerEngineRequestHelpersTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreenStartPositionTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerUsabilityTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModelSharedCoordinatorTest.ktdocs/media3/01-overview-and-setup.mddocs/media3/02-mkv-container-support.mddocs/media3/03-hdr-and-dolby-vision.mddocs/media3/04-atmos-and-audio-codecs.mddocs/media3/05-passthrough-tunneling-offload.mddocs/media3/06-android-tv-and-track-selection.mddocs/media3/07-current-implementation-review.mddocs/media3/08-implementation-guide.mddocs/media3/09-direct-play-route-planning-spec.mddocs/media3/10-reference-player-comparison.mddocs/media3/README.mddocs/playback/01-media3-only-player-architecture.mddocs/playback/02-migration-compatibility-validation.mddocs/playback/03-reference-implementation-review.mddocs/playback/04-implementation-status-and-dv-handoff.mddocs/playback/README.mdgradle/libs.versions.tomllibass-bridge/build.gradle.ktslibass-bridge/src/main/java/org/siloserver/silo/libass/LibassBridge.javalibass-bridge/src/test/java/org/siloserver/silo/libass/LibassBridgeTimeTest.javaproguard-rules.proscripts/README-ffmpeg-aar.mdscripts/build-dovi-aar.shscripts/build-ffmpeg-aar.shscripts/check-no-mpv-runtime.shsettings.gradle.ktsshared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackModels.ktshared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.ktshared/src/commonMain/kotlin/org/siloserver/silo/network/api/PlaybackApi.ktshared/src/commonMain/kotlin/org/siloserver/silo/repository/PlaybackRepository.ktshared/src/commonTest/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3Test.ktshared/src/commonTest/kotlin/org/siloserver/silo/network/api/PlaybackApiTest.kt
💤 Files with no reviewable changes (48)
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SiloPlaybackServiceEngineSourceTest.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/MpvSoftwareVideoCodecs.kt
- androidTvApp/src/androidMain/AndroidManifest.xml
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendPreference.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineCommand.kt
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerEngineRequestHelpersTest.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/mpv/MpvVideoScaleMode.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/ImmediateServerFallbackPolicy.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/ActivePlayerHolder.kt
- docs/media3/02-mkv-container-support.md
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/PlaybackBackendFallback.kt
- docs/media3/03-hdr-and-dolby-vision.md
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SiloPlaybackServiceMpvSourceTest.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineCommandTest.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/PlaybackBackendFallbackTest.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/mpv/MpvTrackType.kt
- docs/media3/05-passthrough-tunneling-offload.md
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/MpvDeviceFloor.kt
- androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/pip/MobilePictureInPictureSourceTest.kt
- docs/media3/07-current-implementation-review.md
- androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/player/AndroidMpvManifestSourceTest.kt
- docs/media3/01-overview-and-setup.md
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/di/PlayerInfraModule.kt
- docs/media3/04-atmos-and-audio-codecs.md
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/OriginalPlaybackRequestPolicy.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/MpvSoftwareVideoCodecPolicyTest.kt
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/player/AndroidTvMpvManifestSourceTest.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/mpv/MpvSubtitleStyleTest.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/MpvVideoPlaybackBackend.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/SiloPlayerFactoryMpvAuthSourceTest.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackFormFactor.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineDecisionTest.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/MpvVideoPlaybackBackendSourceTest.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/PlaybackEngineDecision.kt
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/TracksSheet.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackRecoveryPlanner.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackRecoveryPlannerTest.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendKind.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/mpv/MpvPlayer.kt
- androidApp/src/androidMain/AndroidManifest.xml
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackend.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/mpv/MpvSubtitleStyle.kt
- docs/media3/06-android-tv-and-track-selection.md
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/mpv/MpvPlayerSourceTest.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/OriginalPlaybackRequestPolicyTest.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/VideoBackendCapabilitiesTest.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/VideoPlaybackBackendSelectorTest.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/backend/MpvDeviceFloorTest.kt
👮 Files not reviewed due to content moderation or server errors (2)
- android-shared/libs/media3-decoder-ffmpeg-1.10.1.aar
- android-shared/libs/silo-dovi-bridge-2.3.1.aar
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerOverlay.kt`:
- Around line 106-111: Update the in-room branch of gatedSkipForward to only
apply coerceAtMost(state.duration) when state.duration is greater than 0.0;
otherwise use the calculated forward position unchanged, matching the
performRelativeSeek behavior while preserving the existing seekEnabled and
non-room paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ad0a8e4f-f51b-4e9c-a8d5-6d06bd2c62e6
📒 Files selected for processing (36)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackV3Session.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/seek/Media3SeekRecoveryPolicy.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/seek/PendingSeekPresentationGuard.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/seek/PlaybackTimelineSeekPolicy.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/seek/QuickSkipAccumulator.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlaybackSessionCoordinator.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlaybackStartResult.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlayerUiState.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackSessionManagerSeekReanchorTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackV3SessionTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/seek/Media3SeekRecoveryPolicyTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/seek/PendingSeekPresentationGuardTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/seek/PlaybackTimelineSeekPolicyTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/seek/QuickSkipAccumulatorTest.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileVideoPlaybackStarter.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerGestureHandler.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerOverlay.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreenStartPositionTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModelSharedCoordinatorTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModelStartPositionTest.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvSeekRecoveryQueue.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvCleanPlaybackSeekTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerControlsUsabilityTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreenStartPositionTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModelSharedCoordinatorTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvSeekRecoveryQueueTest.ktshared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackModels.ktshared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.ktshared/src/commonTest/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3Test.ktshared/src/commonTest/kotlin/org/siloserver/silo/network/api/PlaybackApiTest.kt
🚧 Files skipped from review as they are similar to previous changes (16)
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlaybackSessionCoordinator.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlaybackStartResult.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/VideoPlayerUiState.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackV3Session.kt
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreenStartPositionTest.kt
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileVideoPlaybackStarter.kt
- androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModelSharedCoordinatorTest.kt
- shared/src/commonTest/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3Test.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.kt
- shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.kt
- shared/src/commonTest/kotlin/org/siloserver/silo/network/api/PlaybackApiTest.kt
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt
- shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackModels.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c972c70be
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetector.kt (1)
79-97: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winReset
decoderStartupAtMswhen playback is pausedPausing while the decoder-startup deadline is armed leaves
decoderStartupAtMsintact, so a later resume counts the paused interval towarddecoder_no_output/render_startup_failureand can fire immediately. Clear or re-anchor this timer whenplayWhenReadyis false, like the resume stall detector does.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetector.kt` around lines 79 - 97, Reset or re-anchor decoderStartupAtMs whenever playWhenReady is false in the playback startup stall detection flow. Ensure a later resume starts a fresh decoder startup grace period rather than counting paused time, while preserving the existing decoder_no_output and render_startup_failure classification behavior.
🧹 Nitpick comments (1)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt (1)
117-195: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate
ActiveVideoAttemptconstruction in the Playable and ReplanRequired branches.Lines 117-135 and 177-195 build nearly identical
ActiveVideoAttemptinstances (same field set, differing only insessionId/plan/serverFeatures/planAttemptKey/attemptedPlanKeys). Extracting a small factory helper would reduce the risk of the two branches drifting when a field is added later.♻️ Suggested extraction
+ private fun newActiveAttempt( + fileId: Int, + profileId: String, + capabilities: ClientCodecCapabilities, + context: ClientPlaybackContext, + playbackAttemptId: String, + qualityPreference: String, + network: PlaybackNetworkSnapshot, + sessionId: String, + plan: PlaybackPlanV3, + serverFeatures: Set<String>, + planAttemptId: String, + planAttemptKey: String, + ) = ActiveVideoAttempt( + fileId = fileId, + profileId = profileId, + capabilities = capabilities, + context = context, + playbackAttemptId = playbackAttemptId, + qualityPreference = qualityPreference, + networkEvidence = network, + sessionId = sessionId, + plan = plan, + serverFeatures = serverFeatures, + planAttemptId = planAttemptId, + planAttemptKey = planAttemptKey, + localMutations = emptyList(), + attemptedPlanKeys = listOf(planAttemptKey), + attemptCount = 1, + startedAtElapsedRealtimeMs = SystemClock.elapsedRealtime(), + firstFrameReported = false, + )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt` around lines 117 - 195, Extract the shared ActiveVideoAttempt construction into a small factory helper near the surrounding playback-session logic, parameterizing the differing sessionId, plan, serverFeatures, planAttemptId, and planAttemptKey values. Update both the Playable and PlaybackV3Validation.ReplanRequired branches to call the helper while preserving their existing attemptedPlanKeys and all common field values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetector.kt`:
- Around line 79-97: Reset or re-anchor decoderStartupAtMs whenever
playWhenReady is false in the playback startup stall detection flow. Ensure a
later resume starts a fresh decoder startup grace period rather than counting
paused time, while preserving the existing decoder_no_output and
render_startup_failure classification behavior.
---
Nitpick comments:
In
`@android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt`:
- Around line 117-195: Extract the shared ActiveVideoAttempt construction into a
small factory helper near the surrounding playback-session logic, parameterizing
the differing sessionId, plan, serverFeatures, planAttemptId, and planAttemptKey
values. Update both the Playable and PlaybackV3Validation.ReplanRequired
branches to call the helper while preserving their existing attemptedPlanKeys
and all common field values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0856bb41-3ca0-48b5-b525-b56deee2fd29
📒 Files selected for processing (29)
AGENTS.mdandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/di/PlayerModule.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudioCapabilityManager.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AuthenticatedDataSourceFactory.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptor.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthSession.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackNetworkMonitor.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackV3Session.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlayerOkHttpClient.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlayerStatsSnapshot.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SubtitleManager.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetector.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PostResumeVideoStallDetector.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptorTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackBufferPolicyTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlayerStatsSnapshotReducerTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/audio/PassthroughSuppressionRegistryTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetectorTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/PostResumeVideoStallDetectorTest.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerOverlay.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreenStartPositionTest.ktgradle/libs.versions.tomllibass-bridge/build.gradle.ktsscripts/check-no-mpv-runtime.shshared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.ktshared/src/commonMain/kotlin/org/siloserver/silo/repository/PlaybackRepository.ktshared/src/commonTest/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3Test.ktshared/src/commonTest/kotlin/org/siloserver/silo/network/api/PlaybackApiTest.kt
🚧 Files skipped from review as they are similar to previous changes (20)
- libass-bridge/build.gradle.kts
- scripts/check-no-mpv-runtime.sh
- gradle/libs.versions.toml
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackV3Session.kt
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreenStartPositionTest.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/PostResumeVideoStallDetectorTest.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthSession.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/di/PlayerModule.kt
- shared/src/commonMain/kotlin/org/siloserver/silo/repository/PlaybackRepository.kt
- shared/src/commonTest/kotlin/org/siloserver/silo/network/api/PlaybackApiTest.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptor.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlayerStatsSnapshot.kt
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerOverlay.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackNetworkMonitor.kt
- shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AudioCapabilityManager.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackBufferPolicyTest.kt
- shared/src/commonTest/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3Test.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/SubtitleManager.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/AuthenticatedDataSourceFactory.kt
|
Addressed the completed CodeRabbit review summary in 7b60314:
Focused session/stall tests, the Media3-only guard, and both phone/TV debug builds pass. |
There was a problem hiding this comment.
💡 Codex Review
When the V3 planner satisfies an auto/quality request with a different effective_media_file_id, the TV starter still publishes the originally selected version.fileId and its metadata. TvPlayerViewModel then prefers selectedFileId over mediaFileId for version switches, local track selection, missing-session reloads, and subtitle actions, so the TV UI and restarts remain pinned to the wrong version while the effective stream is playing; derive an effective file/version from resolved.mediaFileId or readyV3.plan.effectiveMediaFileId before building the result.
On TV V3 starts, resolved.subtitleUrls comes from PlaybackV3Session and only contains the selected subtitle artifact, often null when playback starts with subtitles off. TvPlayerScreen builds the MediaItem from state.subtitleUrls, so unselected catalog/external subtitles are never mounted and cannot appear in the HUD or be selected; merge the effective version's catalog subtitle tracks into this list before returning, as the mobile starter now does.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Fresh evidence is that this TV starter still publishes the requested version.fileId even though resolved.mediaFileId or readyV3.plan.effectiveMediaFileId can point at a different file chosen by the V3 planner. When auto/quality selection resolves to another effective file, TvPlayerViewModel stores this value as selectedFileId and prefers it over mediaFileId for track persistence, version identity, and seek/recovery replans, so TV can save and recover against the requested file while playing the effective one. Use the resolved/effective file id and matching version metadata here.
When a V3 TV start leaves subtitles off or returns only the selected converted artifact, resolved.subtitleUrls contains no catalog alternatives, so this mounts an empty/single subtitle list into TvPlayerScreen and Media3 never discovers the available sidecar choices. Mobile now merges the effective file's catalog tracks with the selected V3 artifact before returning subtitleUrls; TV needs the same catalog-based list or users cannot select unmounted subtitles from the tracks menu.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Addressed the two additional review-summary findings in 1bd1bcc:
All shared, android-shared, phone, and TV unit-test suites pass. @coderabbitai review |
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.kt`:
- Around line 128-133: Update the playback selection logic around
effectiveFileId and effectiveVersion so the file ID is derived from the version
actually selected from watchDetail.versions, including the fallback to version
when no catalog entry matches; use that single effectiveVersion consistently for
fileResolution, container and duration fallbacks, chapters, subtitle choices,
and sessionLifecycle.adoptActiveSession instead of retaining an unmatched
resolved ID.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 10d7261f-0877-4c26-9b29-4ef61b230757
📒 Files selected for processing (17)
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthSession.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.ktandroid-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetector.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/MediaAuthInterceptorTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackSessionManagerSeekReanchorTest.ktandroid-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetectorTest.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileVideoPlaybackStarter.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.ktandroidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModelSharedCoordinatorTest.ktandroidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/SubtitleTrackSelectionTest.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/PlayerTrackEntriesTest.ktandroidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModelSharedCoordinatorTest.ktshared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackSubtitleChoices.ktshared/src/commonTest/kotlin/org/siloserver/silo/model/playback/PlaybackSubtitleChoicesTest.kt
🚧 Files skipped from review as they are similar to previous changes (12)
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/MediaAuthSession.kt
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/PlayerTrackEntriesTest.kt
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileVideoPlaybackStarter.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetector.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/video/PlaybackStartupStallDetectorTest.kt
- android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackSessionManagerSeekReanchorTest.kt
- androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModelSharedCoordinatorTest.kt
- android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt
- androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt
- androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt
- androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModelSharedCoordinatorTest.kt
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1bd1bcc05d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0edc91026e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| sessionLifecycle.adoptActiveSession( | ||
| params = StartParams( | ||
| contentId = state.contentId, | ||
| fileId = fileId, |
There was a problem hiding this comment.
Adopt the effective file on mobile replans
When a mobile runtime replan resolves an auto/quality/output fallback to a different effective_media_file_id, this still re-homes the lifecycle under the originally selected fileId, and the state update below only swaps the stream/plan without updating selectedVersionIndex/mediaFileId/duration/chapters/subtitle metadata. In that case the phone can play file B while progress, stop ownership, track menus, and persistence remain attached to file A; use decision.session.mediaFileId or decision.plan.effectiveMediaFileId here as the TV replan path does.
Useful? React with 👍 / 👎.
| requestHeaders = decision.plan.stream.headers, | ||
| container = decision.plan.stream.container ?: current.container, | ||
| startPosition = decision.plan.timeline.playerStartSeconds, | ||
| mediaMountGeneration = mountGeneration, |
There was a problem hiding this comment.
Merge planned subtitles after mobile replans
When a user selects a catalog-only subtitle row, the replan response is the first place the server returns the materialized sidecar in decision.session.subtitleUrls, but this remount only keeps the stale uiState.subtitleTracks. Since catalog-only rows now intentionally have blank URLs, the mount effect rebuilds Media3 with no sidecar for the newly selected subtitle, so converted/rendered subtitles can never appear until a full reload; update the subtitle list from the replan result before bumping the mount generation.
Useful? React with 👍 / 👎.
| audioTrackIndex = request.audioTrackIndex, | ||
| subtitleTrackIndex = request.subtitleTrackIndex, |
There was a problem hiding this comment.
Translate mobile startup track ordinals
When playback is launched from the phone detail selector with an explicit audio or subtitle row, request.audioTrackIndex/subtitleTrackIndex are UI/catalog ordinals, but startVideoSessionV3 treats them as stable media stream indexes and serializes file:<id>:audio|subtitle:<index>. On files whose stream indexes are not contiguous from zero, the initial V3 plan requests the wrong audio/subtitle track even though later replans translate ordinals; map through the selected version's audioTracks[ordinal].index and subtitleTracks[ordinal].index before this call.
Useful? React with 👍 / 👎.
| audioTrackIndex = request.audioTrackIndex, | ||
| subtitleTrackIndex = request.subtitleTrackIndex, |
There was a problem hiding this comment.
Translate TV startup track ordinals
TV detail/deep-link playback passes the selected row ordinal into VideoPlaybackStartRequest, but this V3 startup call forwards that value as the server/media-file track index. For files where audio/subtitle stream indexes are 1/2 or 3/5 rather than row 0/1, the very first plan starts with the wrong track before any replan path can apply its stable-index mapping; translate the request ordinals through the chosen FileVersion track metadata here.
Useful? React with 👍 / 👎.
| audioTracks = version?.audioTracks ?: emptyList(), | ||
| selectedAudioIndex = playbackState.audioTrackIndex, | ||
| selectedAudioIndex = selectedAudioOrdinal, | ||
| selectedSubtitleIndex = resolvedSubtitleIndex, |
There was a problem hiding this comment.
Materialize catalog-only subtitles on initial mobile selection
When the server starts with subtitles off, buildPlaybackSubtitleChoices now keeps catalog alternatives as rows with blank URLs, and this initialization can auto/restore one of those rows by setting selectedSubtitleIndex. The screen then only attempts a local Media3 selection, so an external subtitle with no planned artifact is never requested from the V3 server and cannot appear on initial playback; if the resolved initial row has no URL, trigger a subtitle replan or defer selection until the artifact is materialized.
Useful? React with 👍 / 👎.
| PlayerSubtitleInfo( | ||
| index = selectedTracks.subtitle?.index ?: 0, | ||
| codec = artifact.format, | ||
| label = if (rendersEmbeddedBitmap) null else "Server subtitle", | ||
| source = if (rendersEmbeddedBitmap) "embedded" else "server_artifact", | ||
| url = if (rendersEmbeddedBitmap) "" else artifact.url, | ||
| ), |
There was a problem hiding this comment.
Preserve subtitle artifact timing origins
For a V3 converted/rendered subtitle artifact with a non-zero timing_origin_seconds (for example a copy-mode HLS or re-anchored stream whose player timeline starts at 0 while cues are in source time), this conversion drops the timing origin and leaves only the raw URL/format. Media3 then parses the sidecar against the mounted player timeline with no offset, so captions can be shifted by the stream origin; carry the artifact timing through to the subtitle configuration/parser offset instead of discarding it here.
Useful? React with 👍 / 👎.
| subtitleUrls = buildPlaybackSubtitleChoices( | ||
| catalogTracks = effectiveVersion?.subtitleTracks.orEmpty(), | ||
| plannedTracks = resolved.subtitleUrls.orEmpty(), |
There was a problem hiding this comment.
Expose TV catalog subtitles outside Media3 tracks
When the TV starts with subtitles off, catalog subtitle alternatives are merged into subtitleUrls as metadata-only rows with blank URLs, but the TV HUD is populated from Media3-reported subtitleTracks, not from subtitleUrls. Because blank-url external rows are not mounted into Media3, users never see those subtitle choices and cannot trigger the V3 materialization path; add a TV picker path for catalog rows or request the artifact when such a row is chosen.
Useful? React with 👍 / 👎.
| // A sign-out that wins the race must not be undone by a late | ||
| // refresh response. | ||
| if (tokenManager.getRefreshToken().isNullOrBlank()) { | ||
| return@use false | ||
| } |
There was a problem hiding this comment.
Verify the refresh token before saving media refreshes
The remaining fresh race is same-server re-auth: if the user signs out and logs back into the same configured server while an old media refresh response is in flight, serverId still matches and this guard only checks that some refresh token exists. The stale response can then reach saveTokens and overwrite the newly logged-in session; capture the refresh token used for the request and require it to still match (or save to a pinned scope) before persisting the response.
Useful? React with 👍 / 👎.
WIP status
This is an early review PR for the new Android playback stack. It is intentionally a draft and should not merge until the server v3 contract and real 4K Dolby Vision / HDR / AVR validation are complete.
Summary
docs/playback/.Validation completed
./scripts/check-no-mpv-runtime.sh:androidTvApp:assembleDebug:androidApp:assembleDebugdocs/playback/04-implementation-status-and-dv-handoff.md.Remaining before ready
Review focus
Please focus first on the v3 contract, capability claims, plan/replan lifecycle, MPV removal boundaries, and whether any client behavior could falsely claim direct play, HDR, Dolby Vision, or passthrough support.
Summary by CodeRabbit