Add embedded audio/subtitle track selection for multi-track files

Files with multiple embedded tracks (e.g. MKV from media sources or
downloads) previously exposed none of them: mpv's track-list was never
read, aid was never set, and sid was only ever no/auto. The quality
selector showed no Audio or Subtitles tab for such files.

MPVClient now observes track-list/aid/sid and delivers a coalesced,
leniently decoded [MPVTrack] snapshot; selection state is derived from
the reported "selected" flags. Embedded tracks are switched live via
aid/sid (no reload), surfaced in the existing Audio/Subtitles sections
alongside external captions on iOS, tvOS and macOS. External sub-add/
audio-add tracks are filtered out to avoid double-listing. User picks
are sticky across same-video reloads (quality switch, audio mode,
retries) and preferred audio/subtitle languages auto-select a matching
embedded track once per load, with external captions taking precedence.
This commit is contained in:
Arkadiusz Fal
2026-07-29 22:14:46 +02:00
parent 150ebf42a4
commit 67ed8c322b
17 changed files with 841 additions and 11 deletions

View File

@@ -7886,6 +7886,39 @@
}
}
},
"player.track.default" : {
"comment" : "Badge for the container's default embedded track",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "DEFAULT"
}
}
}
},
"player.track.forced" : {
"comment" : "Badge for forced embedded subtitle tracks",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "FORCED"
}
}
}
},
"player.track.number %lld" : {
"comment" : "Fallback name for an embedded track without title or language",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Track %lld"
}
}
}
},
"player.tvos.volumeDown" : {
"extractionState" : "stale",
"localizations" : {