Skip to content

Auto subtitle selection: demote CC/"Closed Caption"-titled tracks like SDH ones (parity with silo-apple) #35

Closed

Description

@zZebrahz

Context

Auto subtitle selection is resolved client-side on each platform. When ranking same-language tracks, both clients prefer full-dialogue tracks by demoting forced and hearing-impaired ones — but tracks that are only titled as captions (e.g. English (CC)), without the ffmpeg hearing_impaired disposition flag, can still win over a plain dialogue track.

silo-apple just fixed this by adding title-token detection to its ranking (SubtitleAutoResolver.titleIndicatesHearingImpaired in iosApp/iosApp/Screens/Player/PlaybackPrefsResolver.swift): a track counts as CC/SDH when the title contains "closed caption" / "hearing impaired" or a standalone cc / sdh token (token match, not substring, so titles like "Soccer Cut" don't false-positive).

Android gap

The TV client already derives isHearingImpaired from the label via String.isHearingImpairedSubtitleLabel() (androidTvApp/.../player/TvPlayerScreen.kt), but it only matches:

  • sdh
  • hearing / hearing impaired
  • (hi) / hi

It does not match cc / (CC) / closed caption, so bestAutoSubtitleTrack (TvPlayerViewModel.kt) auto-picks a track titled English (CC) over a plain English track when the CC one comes first.

Suggested change

  • Extend isHearingImpairedSubtitleLabel() to also match closed caption and a standalone cc token (word-boundary/token match to avoid hitting words containing "cc").
  • Check the phone client's auto-selection path for the same gap.
  • Expected result: given English (CC) + English tracks in the preferred language, Auto selects English; the CC/SDH track is still used when it is the only option in that language.

Keeps Apple and Android Auto picks consistent for the same file.

Activity

  1. zZebrahz commented on Jul 5, 2026

    @zZebrahz
    ContributorAuthor

    I can handle this later, was just filing a note

  2. Quick104 commented on Sep 4, 2026

    @Quick104
    Contributor

    Implemented on both phone and TV. The shared subtitleLabelIndicatesHearingImpaired recognizes “closed caption” and standalone cc/sdh tokens, and both players use it when resolving subtitle identity and automatic selection. The TV shared resolver landed through PR #228; the underlying identity work is in PR #200.

    Verified main at 8791af20, including regression cases for preferring plain English over English (CC), retaining CC when it is the available choice, and avoiding a false match for “Soccer Cut.” Current main's unit-test check passes. Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions