Repository navigation
Conversation
Advertise hdmv_pgs_subtitle, dvd_subtitle and dvb_subtitle in the MKV native_embedded entry on original_http. Media3 1.11's MatroskaExtractor exposes S_HDMV/PGS, S_VOBSUB and S_DVBSUB with Format.id set to the TrackNumber, and DefaultSubtitleParserFactory decodes all three, so the existing container_track_id selection works unchanged. The server already plans subtitle.embedded for these codecs when the client lists them, which replaces the PGS .sup whole-file extraction and the VobSub/DVB burn-in transcode in direct play. validateForMedia3 accepts the server's short aliases (pgs, pgssub, dvdsub, vobsub, dvbsub). A VobSub or DVB track committed as Embedded now resolves on the detail screen instead of being dropped. codecToMimeType mapped dvd_subtitle/dvdsub to DVBSUBS; it now maps them to VOBSUB and maps dvb_subtitle/dvbsub to DVBSUBS. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 59 minutes. View limit details
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Evidence is missing for these visible playback effects:
The Evidence section says “being published” but contains no captures or evidence link. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
| val NATIVE_EMBEDDED_SUBTITLE_CODECS: Map<String, List<String>> = mapOf( | ||
| "mp4" to listOf("mov_text"), | ||
| "mkv" to listOf("subrip", "ass"), | ||
| "mkv" to listOf("subrip", "ass", "hdmv_pgs_subtitle", "dvd_subtitle", "dvb_subtitle"), |
There was a problem hiding this comment.
Subtitle offset handling fails for native MKV PGS/DVB bitmap cues because OffsetSubtitleParserFactory adds the user's sync offset to Media3's C.TIME_UNSET start-time sentinel, clamping away positive offsets and overflowing Long into an enormous future timestamp for a negative offset such as -100 ms. Handle sample-relative TIME_UNSET timestamps before applying offsets in the embedded parser pipeline so newly advertised native tracks respect subtitle delay and remain visible when advanced.
Prompt for LLM
File shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.kt:
Line 675:
Subtitle offset handling fails for native MKV PGS/DVB bitmap cues because OffsetSubtitleParserFactory adds the user's sync offset to Media3's C.TIME_UNSET start-time sentinel, clamping away positive offsets and overflowing Long into an enormous future timestamp for a negative offset such as -100 ms. Handle sample-relative TIME_UNSET timestamps before applying offsets in the embedded parser pipeline so newly advertised native tracks respect subtitle delay and remain visible when advanced.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| is SubtitleIdentity.Embedded -> | ||
| !external && | ||
| (!codec.isCatalogBitmapSubtitle() || isClientMountableBitmapCodecFamily(codec)) | ||
| is SubtitleIdentity.Embedded -> !external |
There was a problem hiding this comment.
Catalog restoration fails for native VobSub/DVB preferences because playbackSubtitleIdentity stores the inventory serverTrackId in media.trackId while catalogMediaIdentity leaves trackId null, causing matchesTypedCatalogIdentity to reject the newly accepted Embedded row at its subsequent track-ID comparison. Update catalog identity reconciliation so MobileVideoPlaybackStarter retains the remembered selection and TvPlayerSubtitlePolicy can rebuild it, and add a round-trip test using an actual native session row rather than media copied from encodeCatalogSubtitlePreference.
Prompt for LLM
File shared/src/commonMain/kotlin/org/siloserver/silo/playback/TrackSelectionFingerprint.kt:
Line 347:
Catalog restoration fails for native VobSub/DVB preferences because playbackSubtitleIdentity stores the inventory serverTrackId in media.trackId while catalogMediaIdentity leaves trackId null, causing matchesTypedCatalogIdentity to reject the newly accepted Embedded row at its subsequent track-ID comparison. Update catalog identity reconciliation so MobileVideoPlaybackStarter retains the remembered selection and TvPlayerSubtitlePolicy can rebuild it, and add a round-trip test using an actual native session row rather than media copied from encodeCatalogSubtitlePreference.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
The offset wrapper around the embedded subtitle parsers added the user's sync offset to each cue's start. Media3's PGS and DVB parsers report no start of their own (C.TIME_UNSET; the cue starts at its sample), so a positive offset was clamped away and a negative one overflowed into a time the cue never reaches. With MKV bitmap tracks now played from the stream, a viewer who advanced subtitles lost them. A missing start now counts as the sample-relative start 0 it stands for, so the offset applies as it does to Matroska text tracks. The `.sup` sidecar extractor ignores the parser's start and offsets the sample itself, so it is unaffected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9eddbc86c0
ℹ️ 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".
| // sample-relative start of 0. Adding the offset to the TIME_UNSET | ||
| // sentinel instead clamped a positive offset away and overflowed a | ||
| // negative one into a time the cue never reaches. | ||
| val start = if (cues.startTimeUs == C.TIME_UNSET) 0L else cues.startTimeUs |
There was a problem hiding this comment.
Preserve negative offsets for sample-relative bitmap cues
When a viewer advances subtitles with a negative sync offset, the newly enabled native MKV PGS/DVB path ignores the adjustment: converting TIME_UNSET to zero makes rawStart negative, so the following clamp resets every cue to zero relative to its sample. For example, a cue sampled at 60 seconds with a −500 ms offset still appears at 60 seconds instead of 59.5 seconds. Media3's SubtitleTranscodingTrackOutput adds this relative start to the sample timestamp, so negative relative starts must be preserved rather than clamped as though they were absolute playback times. This regresses PGS synchronization compared with the previous .sup path, where PgsSupExtractor applies the offset to the actual sample timestamp.
Useful? React with 👍 / 👎.
|
Superseded by #770, which combines this change with the rest of the stack for review. |
Problem
Related issue: #457, Silo-Server/silo-server#1406
Validation tasks: changes #323 C4; changes #324 C4
When the phone or TV app direct-plays an MKV and the viewer picks an embedded image-based subtitle, the player doesn't draw it from the file it is already playing. A PGS track becomes a
.supsidecar, which the server extracts by reading the whole source file. A VobSub or DVB track has no sidecar at all, so the server burns it into a full video transcode. On large files on slow storage the extraction takes minutes and competes with the video stream (Silo-Server/silo-server#1406).The apps now list the three bitmap families in their MKV
native_embeddedcapability, so the server plans these tracks as native embedded subtitles and Media3 draws them from the original stream, as #457 did for text tracks.Approach
native_embeddedentry onoriginal_httplistshdmv_pgs_subtitle,dvd_subtitleanddvb_subtitle. Media3 1.11'sMatroskaExtractorpublishesS_HDMV/PGS,S_VOBSUBandS_DVBSUBtracks withFormat.idset to the Matroska TrackNumber, andDefaultSubtitleParserFactorydecodes all three, so the existingcontainer_track_idselection works unchanged.validateForMedia3accepts the server's short codec aliases (pgs,pgssub,dvdsub,vobsub,dvbsub).Embeddednow resolves on the detail screen instead of being dropped.codecToMimeTypemappeddvd_subtitleanddvdsubto DVB subtitles. It now maps them to VobSub, anddvb_subtitleanddvbsubto DVB.docs/playback/README.mdlists the new codecs.subtitle.embeddedfor these codecs when a client lists them.Validation
./gradlew testDebugUnitTest: pass, 6,629 tests, 0 failures. New tests cover the advertised codecs, every server alias, selection by Matroska TrackNumber for each bitmap family, and a native bitmap plan mounting no.supsidecar or burn-in fallback../gradlew :android-shared:lintDebug :androidApp:lintDebug :androidTvApp:lintDebug: pass, no new findings.:androidApp:assembleDebugand:androidTvApp:assembleDebug: pass.Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-734/
Risks
native_embeddedentry sends these tracks back to the.supsidecar and burn-in routes.native_embeddedentry.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Add native MKV bitmap subtitle support (PGS, VobSub, DVB) to playback
hdmv_pgs_subtitle,dvd_subtitle, anddvb_subtitleto the MKV native embedded codec list in PlaybackProtocolV3.kt, with alias normalization forpgs,pgssub,dvdsub,vobsub, anddvbsub.OffsetSubtitleParserFactoryto treatC.TIME_UNSETcue starts as sample-relative zero, so offset shifting and clamping work correctly for bitmap cues.SubtitleTrack.matchesTypedCatalogIdentityso embedded identities match any non-external catalog track, letting remembered VobSub and DVB selections restore as embedded tracks.Macroscope summarized 9eddbc8.