Skip to content

fix(playback): restore SDR alternate fallback for burn-in subtitles - #623

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-b40e
Closed

fix(playback): restore SDR alternate fallback for burn-in subtitles#623
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-b40e

Conversation

@cursor

@cursor cursor Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Problem

Follow-up to #617.

Selecting a bitmap (PGS/VOBSUB) subtitle on an HDR source that has an SDR alternate returned adaptation_unavailable with subtitle_conversion_unsupported instead of falling back to the SDR version and burning the subtitle in.

Concrete trigger:

  1. Title has HDR10 4K + SDR 1080p versions.
  2. Start plays the HDR file directly (client claims HDR10).
  3. User selects an embedded PGS track (no bitmap renderer → burn-in required).
  4. Replan terminals instead of adopting the SDR alternate.

Approach

#617 correctly renamed burn-in-only HDR/4K refusals to subtitle_conversion_unsupported so the UI can name the subtitle. terminalAllowsAlternateFileV3 was not updated and still only treated hdr_transcode_unsupported / no_alternate_version as version-shaped blockers, so the existing alternate-file path never ran.

Allow subtitle_conversion_unsupported through the same gate. Alternate selection remains opt-in (quality != original, track/quality/output/failure replan), remaps the subtitle identity, and only adopts the alternate when that plan succeeds. If no alternate works, the subtitle-named terminal still surfaces.

Testing

$ go test ./internal/api/handlers/ -run 'TestTerminalAllowsAlternateFileV3IncludesHDRIncompatibility|TestHandleReplanPlaybackV3BitmapSubtitleFallsBackFromHDRToSDRVersion|Alternate|BitmapSubtitle' -count=1
ok  	github.com/Silo-Server/silo-server/internal/api/handlers

$ go test ./internal/playback/ -run 'NamesTheSubtitle|KeepsTheHDR|DisabledTranscodeStillNames' -count=1
ok  	github.com/Silo-Server/silo-server/internal/playback

$ gofmt -l internal/api/handlers/playback_v3.go internal/api/handlers/playback_v3_test.go
# clean

TestHandleReplanPlaybackV3BitmapSubtitleFallsBackFromHDRToSDRVersion failed on pristine ee9356aa (#617) and passes with this change.

AI Disclosure

  • Tool(s): Cursor
  • Model(s): cursor-grok-4.5-high
  • Involvement: fully AI-generated
  • Adversarial review: Considered whether every subtitle_conversion_unsupported should trigger an alternate attempt. Trying once is safe: remapping can fail closed with subtitle_unavailable_in_version, a failed alternate still surfaces the subtitle-named terminal, and quality=original / seek-only replans remain pinned. Did not broaden planner reason naming from fix(playback): claim Safari DV/HDR10 decode evidence and preserve dvvC in remuxes #617.

Checklist

  • I ran an adversarial AI review of the diff and summarized findings above.
  • I ran the repo verify commands relevant to this change: gofmt and targeted go test for the touched packages. Full make lint / web lint were not required (backend-only, two files).
Open in Web View Automation 

#617 renamed HDR/4K burn-in refusals to subtitle_conversion_unsupported
when the subtitle alone forced adaptation, but terminalAllowsAlternateFileV3
still only recognized the old HDR/4K reasons. Selecting a PGS track on an
HDR source therefore skipped the SDR alternate and returned
adaptation_unavailable.

Co-authored-by: Quick <Quick104@users.noreply.github.com>
@Quick104 Quick104 closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants