Improve display of "DTS:HD" and "DTS:HD MA" audio tracks (#1064)

<!-- By submitting this pull request, you acknowledge that you have read
the [contributing
guide](https://github.com/damontecres/Wholphin/blob/main/CONTRIBUTING.md,
including the AI/LLM policy, and [developer's
guide](https://github.com/damontecres/Wholphin/blob/main/DEVELOPMENT.md)
-->

## Description
The formatter for audio codecs did only match the profile of high
definition DTS streams against "DTS:HD" or "DTS:X". At least for DTS:HD
there are also cases where the profile contains "DTS-HD" with "-"
instead of ":".

Made the matcher more generic by allowing both "-"" or ":"" and also
checking if the profile contains "MA" for Master Audio tracks.

This will now correctly display the following high definition DTS types
in the UI:
- DTS:HD
- DTS:HD MA
- DTS:X

**Note:** This is my first public pull request ever, let me know if I
did it wrong :)

### Related issues
Relates to (but does not fix):
https://github.com/damontecres/Wholphin/issues/1057

### Testing
Tested on a Fire TV Cube Gen 3 with multiple files containing DTS HD
audio tracks.

---------

Co-authored-by: Damontecres <damontecres@gmail.com>
This commit is contained in:
Jannik Mahr 2026-03-11 04:44:44 +01:00 committed by GitHub
parent 0dca02b919
commit cca818fabb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 22 additions and 6 deletions

View file

@ -92,12 +92,13 @@ object StreamFormatting {
context.getString(R.string.dolby_atmos)
}
profile?.contains("DTS:X", true) == true -> {
context.getString(R.string.dts_x)
}
profile?.contains("DTS:HD", true) == true -> {
context.getString(R.string.dts_hd)
profile?.contains("DTS", true) == true -> {
when {
profile.contains("X", true) -> context.getString(R.string.dts_x)
profile.contains("MA", true) -> context.getString(R.string.dts_hd_ma)
profile.contains("HD", true) -> context.getString(R.string.dts_hd)
else -> context.getString(R.string.dts)
}
}
else -> {