Skip to content

Optimize subtitle HLS renditions for AirPlay - #64

Open
hikaps wants to merge 3 commits into
developfrom
efficiency
Open

hikaps wants to merge 3 commits into
developfrom
efficiency

Conversation

@hikaps

@hikaps hikaps commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • eliminate duplicate video output when multiple subtitle renditions are present
  • generate stable WebVTT HLS subtitle playlists and deterministic selected-subtitle markers
  • keep AirPlay route-sharing policy and native subtitle selection behavior consistent

Verification

  • ./gradlew :composeApp:jvmTest :composeApp:koverVerify --console=plain
  • ./gradlew :composeApp:iosSimulatorArm64Test --console=plain
  • complete unsigned Swift XCTest suite on iPhone 16 Pro iOS 18.2 simulator

Physical AirPlay receiver validation remains to be performed.

@hikaps

hikaps commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Addressed review findings in commit bdc6950:

  • omit SUBTITLES="subs" when no subtitle renditions exist
  • align WebVTT output to the media timeline with empty gap segments and bounded target duration
  • publish empty valid subtitle playlists before the first cue
  • preserve valid sidecars that are empty after a seek; fail only decode errors
  • retain all renditions for decoder cleanup

Verification passed:

  • complete Swift XCTest suite on iPhone 16 Pro iOS 18.2 simulator
  • JVM tests + Kover
  • Kotlin iOS simulator tests
  • review-specific late-cue and no-subtitle-master tests

@hikaps

hikaps commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Resolved the remaining timeline findings in commit f42e4d5:

  • subtitle renditions now use fixed four-second video-timeline periods
  • intersecting cues retain their original timestamps across every affected period
  • each WebVTT segment includes X-TIMESTAMP-MAP aligned to the A/V timestamp origin
  • overlapping cues are retained instead of advancing from the previous cue end
  • #EXT-X-TARGETDURATION:4 is fixed from initial publication through finalization

Added regression coverage for late cues, gap periods, original timestamps, timestamp mapping, and fixed target duration. Full Swift XCTest, JVM/Kover, and Kotlin iOS simulator suites pass.

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.

1 participant