Skip to content

feat(apple): detect and label Dolby media formats - #72

Closed
raiden202 wants to merge 9 commits into
Silo-Server:mainfrom
raiden202:pr/apple-audio-profile-atmos
Closed

raiden202 wants to merge 9 commits into
Silo-Server:mainfrom
raiden202:pr/apple-audio-profile-atmos

Conversation

@raiden202

@raiden202 raiden202 commented Jul 7, 2026 •

Copy link
Copy Markdown

Problem

Some streams expose Dolby Atmos only in the audio stream profile, while Dolby Vision may be represented by dolby_vision, dv_profile, video_range, or video_range_type. The Apple client could therefore render profile-only Atmos as plain 5.1/EAC3, reduce Dolby Vision to generic HDR, show resolution and dynamic range as separate badges, or collapse a known carrier to generic ATMOS during playback.

Approach

Decode the optional audio-profile and Dolby Vision fields already emitted by the server. Preserve the audio profile through PlayerTrack and loopback planning so profile-only EAC3 Atmos keeps the existing preservesAtmos/mayClaimAtmos behavior.

Centralize detail formatting in DetailPlaybackFormatting: EAC3 Atmos renders as DD+ Atmos, TrueHD Atmos as TrueHD Atmos, and unknown Atmos codecs retain the conservative Atmos fallback. Dolby Vision evidence takes precedence over generic HDR.

Phone and tvOS detail heroes use one full video chip such as 4K Dolby Vision or 4K HDR. Compact home-card overlays use 4K DV and Atmos; combined non-Dolby formats preserve specific labels such as 4K HDR10 and 4K HLG. Carrier-specific audio labels are reserved for roomier detail and player metadata. Deliberately placing resolution and HDR overlays in different corners keeps them separate. The focused-card marquee and in-player hero strip combine video quality and preserve the precise Atmos carrier. The player strip follows the selected session audio track, falling back to the server-effective/default track when needed. No stored overlay preference is rewritten.

Offline media constructors retain existing behavior by leaving unavailable profile and Dolby Vision metadata unset.

Verification

  • Regenerated the Xcode project with xcodegen generate.
  • SiloTV builds successfully for the tvOS Simulator with code signing disabled.
  • Focused test coverage is included for profile-only Atmos, codec-specific Atmos labels, Dolby Vision precedence, combined quality badges including HLG preservation, and selected-track player metadata.
  • git diff --check origin/main...HEAD passes.
  • Diff and commit metadata scans found no local paths, hostnames, private addresses, credentials, or personal data.

This does not claim device-level Atmos output testing.

Risks & follow-up

The overlay change is presentation-only and preserves intentional different-corner layouts. The compact server summary remains Atmos; detail and player carrier labels derive from full audio-track metadata instead. Runtime decoder diagnostics also remain unchanged so they continue to describe the actual output stream rather than source-file metadata.

AI-use disclosure

Implemented with a combination of Claude Code and Codex assistance, with human oversight.

Summary by CodeRabbit

  • New Features

    • Improved Dolby Vision and HDR badges across detail pages, hero areas, overlays, and the player.
    • Added more accurate Atmos detection and codec-specific labels, including DD+ Atmos and TrueHD Atmos.
    • Combined video quality badges now display resolution and dynamic range more consistently.
    • Audio profile metadata is preserved during playback and offline media handling.
  • Bug Fixes

    • Improved Atmos preservation when selecting and routing audio tracks.
    • Corrected badge precedence and merging for combined quality overlays.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2797adb2-1c0b-46d0-9d43-7b3b960c3719

📥 Commits

Reviewing files that changed from the base of the PR and between 411e62e and 7b61703.

📒 Files selected for processing (2)
  • iosApp/Tests/DetailVersionSelectionTests.swift
  • iosApp/iosApp/Overlays/OverlayRegistry.swift
🚧 Files skipped from review as they are similar to previous changes (2)
  • iosApp/iosApp/Overlays/OverlayRegistry.swift
  • iosApp/Tests/DetailVersionSelectionTests.swift

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds Dolby Vision and audio profile metadata decoding, centralizes Atmos and dynamic-range badge formatting, propagates audio hints through playback routes, updates phone and tvOS badges, and combines home resolution and dynamic-range overlays. Tests cover the new metadata and label behavior.

Changes

Playback metadata labeling and propagation

Layer / File(s) Summary
Media metadata contracts and Atmos hints
iosApp/iosApp/Networking/Models.swift, iosApp/iosApp/Screens/Player/PlayerTrack.swift, iosApp/iosApp/Downloads/*
VideoTrack decodes Dolby Vision range and profile fields. AudioTrack decodes profile. PlayerTrack stores audio profiles and derives hasAtmosHint.
Shared badge formatting
iosApp/iosApp/Screens/Detail/DetailPlaybackFormatting.swift
Dolby Vision detection uses multiple metadata fields. Atmos detection uses profile, layout, title, and embedded title data. Audio badges use codec-specific labels.
Playback and detail-view integration
iosApp/iosApp/Screens/Player/*, iosApp/iosApp/Screens/Detail/*, iosApp/iosApp/tvOS/*
Phone, tvOS, marquee, and player metadata use shared video and Atmos badge formatters. Loopback routes preserve audio profile metadata and use hasAtmosHint.
Home overlay combination
iosApp/iosApp/Overlays/OverlayRegistry.swift
Resolution and dynamic-range overlays combine when enabled at the same corner. Combined labels normalize Dolby Vision and preserve other nonempty values.
Metadata and badge validation
iosApp/Tests/DetailVersionSelectionTests.swift, iosApp/Tests/*Playback*Tests.swift, iosApp/Tests/HDRDisplayCriteriaPolicyTests.swift
Tests cover Atmos profiles, Dolby Vision precedence, hero and player badges, overlay placement, and updated media fixtures.

Estimated code review effort: 4 (Complex) | ~60 minutes

Merge Risk: ⚪ Minimal · up to 7b617

This change adds Dolby Atmos and Dolby Vision labeling while preserving existing playback behavior; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Server
  participant AudioTrack
  participant PlayerTrack
  participant PlaybackSessionBridge
  participant DetailPlaybackFormatting
  participant OverlayRegistry
  Server->>AudioTrack: decode audio profile and video metadata
  AudioTrack->>PlayerTrack: propagate audioProfile
  PlayerTrack->>PlayerTrack: compute hasAtmosHint
  PlaybackSessionBridge->>DetailPlaybackFormatting: request video and Atmos labels
  DetailPlaybackFormatting-->>PlaybackSessionBridge: return formatted badges
  OverlayRegistry->>OverlayRegistry: combine resolution and dynamic-range badges
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.79% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: detecting and labeling Dolby media formats.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
iosApp/Tests/DetailVersionSelectionTests.swift (1)

197-223: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Test correctly targets profile-only Atmos detection, but depends on the missing wiring flagged in DetailPlaybackFormatting.swift.

Given the current compactAudioLayout implementation (unchanged), the audioValueLabel assertion at Lines 218-221 expecting "EAC3 Atmos" will fail, since compactAudioLayout doesn't consult profile. Once the label-formatting fix is applied, this test should pass as written.

🤖 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 `@iosApp/Tests/DetailVersionSelectionTests.swift` around lines 197 - 223, The
new test in DetailVersionSelectionTests correctly covers profile-only Atmos
detection, but the audio label path still ignores the track profile in
DetailPlaybackFormatting. Update the audio formatting logic used by
audioValueLabel, specifically compactAudioLayout and any helper it calls, so it
consults DetailPlaybackFormatting.audioTrackIsAtmos(track) and appends Atmos
when the profile indicates it even without a title hint. Keep the existing test
as-is and ensure the labeling flow for versions[0] and selectedAudioTrackIndex
nil returns the expected Atmos string.
🤖 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 `@iosApp/iosApp/Screens/Detail/DetailPlaybackFormatting.swift`:
- Around line 524-533: Update the audio label formatter so it uses the existing
audioTrackIsAtmos helper when building audioTitle/compactAudioLayout. Right now
the formatter only inspects channelLayout, so Atmos tracks identified via
profile, title, or embeddedTitle still render as plain 5.1; adjust the logic in
DetailPlaybackFormatting to append or prefer “Atmos” whenever
audioTrackIsAtmos(_:) returns true.

---

Duplicate comments:
In `@iosApp/Tests/DetailVersionSelectionTests.swift`:
- Around line 197-223: The new test in DetailVersionSelectionTests correctly
covers profile-only Atmos detection, but the audio label path still ignores the
track profile in DetailPlaybackFormatting. Update the audio formatting logic
used by audioValueLabel, specifically compactAudioLayout and any helper it
calls, so it consults DetailPlaybackFormatting.audioTrackIsAtmos(track) and
appends Atmos when the profile indicates it even without a title hint. Keep the
existing test as-is and ensure the labeling flow for versions[0] and
selectedAudioTrackIndex nil returns the expected Atmos string.
🪄 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: 56df70f8-19eb-4f82-bbe2-5538ce3089c7

📥 Commits

Reviewing files that changed from the base of the PR and between f12a928 and 8780f1b.

📒 Files selected for processing (3)
  • iosApp/Tests/DetailVersionSelectionTests.swift
  • iosApp/iosApp/Networking/Models.swift
  • iosApp/iosApp/Screens/Detail/DetailPlaybackFormatting.swift

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8780f1bba0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread iosApp/iosApp/Networking/Models.swift Resolved
@raiden202
raiden202 force-pushed the pr/apple-audio-profile-atmos branch from 8780f1b to 480efd9 Compare July 8, 2026 18:46
@raiden202

Copy link
Copy Markdown
Author

Addressed the review threads in 480efd9: the profile-only Atmos test is now throwable, detail audio labels call the Atmos detector before falling back to plain channel layout, and loopback PlayerTrack metadata now carries audioProfile through the route planner / PlayerViewModel / AVPlayer backend so profile-only EAC3 Atmos can set preservesAtmos and mayClaimAtmos correctly.

@raiden202
raiden202 force-pushed the pr/apple-audio-profile-atmos branch 2 times, most recently from 3974269 to 55f4db2 Compare July 10, 2026 11:27
@raiden202 raiden202 changed the title feat(tvos): detect Atmos from audio stream profile feat(apple): detect and label Dolby media formats Jul 10, 2026
@raiden202
raiden202 force-pushed the pr/apple-audio-profile-atmos branch from 55f4db2 to 696838c Compare July 10, 2026 16:52
@raiden202

Copy link
Copy Markdown
Author

Rebased onto current main after #83. The conflict resolution keeps #83’s language-first selector presentation, while compact audio values and selector details now use DD+ Atmos / TrueHD Atmos when supported by stream metadata. The focused detail-formatting suite passes on tvOS, and both SiloTV and SiloMac build successfully.

@raiden202
raiden202 force-pushed the pr/apple-audio-profile-atmos branch from 696838c to 71caa2a Compare July 16, 2026 08:23
@raiden202
raiden202 force-pushed the pr/apple-audio-profile-atmos branch from 71caa2a to 9fc614c Compare July 23, 2026 11:47

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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 `@iosApp/iosApp/Overlays/OverlayRegistry.swift`:
- Around line 114-120: Update combinedDynamicRangeLabel to return "Dolby Vision"
for Dolby Vision values, but preserve the original non-Dolby-Vision value
instead of collapsing it to "HDR", matching
DetailPlaybackFormatting.heroVideoBadgeLabel behavior for HDR10, HLG, and other
raw values.

In `@iosApp/iosApp/Screens/Detail/DetailPlaybackFormatting.swift`:
- Around line 552-571: Update heroVideoBadgeLabel’s normalizedDynamicRange
closure to return “Dolby Vision” for Dolby Vision values and collapse every
other non-empty dynamicRange value to the literal “HDR”, matching
OverlayRegistry.combinedDynamicRangeLabel and keeping combined labels consistent
across hero and home-card badges.
🪄 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: ba34b5e7-e3b1-4168-a9bb-226a20671b30

📥 Commits

Reviewing files that changed from the base of the PR and between 55f4db2 and 9e3019a.

📒 Files selected for processing (14)
  • iosApp/Tests/DetailVersionSelectionTests.swift
  • iosApp/Tests/HDRDisplayCriteriaPolicyTests.swift
  • iosApp/iosApp/Networking/Models.swift
  • iosApp/iosApp/Overlays/OverlayExtractors.swift
  • iosApp/iosApp/Overlays/OverlayRegistry.swift
  • iosApp/iosApp/Screens/Detail/DetailPlaybackFormatting.swift
  • iosApp/iosApp/Screens/Detail/Phone/PhoneHeroMetadata.swift
  • iosApp/iosApp/Screens/Player/AVPlayerRoute/AVPlayerBackend.swift
  • iosApp/iosApp/Screens/Player/ApplePlaybackRoutePlanner.swift
  • iosApp/iosApp/Screens/Player/PlaybackSessionBridge.swift
  • iosApp/iosApp/Screens/Player/PlayerTrack.swift
  • iosApp/iosApp/Screens/Player/PlayerViewModel.swift
  • iosApp/iosApp/tvOS/Components/TVFocusMarquee.swift
  • iosApp/iosApp/tvOS/Screens/Detail/TVDetailHero.swift
🚧 Files skipped from review as they are similar to previous changes (5)
  • iosApp/iosApp/Networking/Models.swift
  • iosApp/iosApp/Screens/Player/PlayerViewModel.swift
  • iosApp/iosApp/Screens/Player/PlayerTrack.swift
  • iosApp/iosApp/Screens/Player/AVPlayerRoute/AVPlayerBackend.swift
  • iosApp/iosApp/Screens/Player/ApplePlaybackRoutePlanner.swift

Silo Contributor and others added 8 commits August 17, 2026 07:03
Decode the optional audio track profile field and include it in the shared Atmos detector. This is additive for older servers and lets tvOS recognize Atmos when the stream profile carries the signal but the title and layout do not.
The combined card formatter expanded DV when hero labels were unified. Restore compact DV card labels while keeping full Dolby Vision text on hero and player surfaces.
@raiden202
raiden202 force-pushed the pr/apple-audio-profile-atmos branch from e128fbe to 411e62e Compare August 17, 2026 11:14
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Quick104 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Silo's pull request guidance changed today (#658). A PR that changes what a user sees now needs before-and-after evidence in its Evidence section, and a PR with no visible change says Evidence: none, no user-visible change. This PR was opened before the rule existed, so it hasn't had a chance to meet it yet.

Missing here: Before-and-after screenshots of the iOS and tvOS detail heroes for an Atmos or Dolby Vision title, showing the new format labels.

The rules are in Show visible changes, and the PR template shows the Evidence section layout. I've converted this PR to draft for now. Mark it ready for review once the Evidence section is filled in.


Generated by Claude Code

@Quick104
Quick104 marked this pull request as draft October 6, 2026 19:26
@Quick104 Quick104 closed this Oct 7, 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