jarnedemeulemeester / findroid

Third-party native Jellyfin Android app
GNU General Public License v3.0
2.69k stars 167 forks source link

Preferred language does not select proper language on MPV, #737 cont. #804

Closed nattadasu closed 3 months ago

nattadasu commented 3 months ago

Describe the bug This is a follow-up issue of #737, which may also caused by https://github.com/androidx/media/blob/d833d59124d795afc146322fe488b2c0d4b9af6a/libraries/common/src/main/java/androidx/media3/common/util/Util.java#L3837.

Although that it does correctly detect language codes, when a video contains msa (Malaysian) subtitles and preferred language is ind, MPV rather pick msa subtitle instead.

When Malay subtitle does not exist, MPV set to default embedded subtitle instead, or in some rare cases, none selected.

To Reproduce Steps to reproduce the behavior:

  1. Obtain subtitles in English and Indonesia
  2. Set preferred subtitle language to Indonesia
  3. Observe selection
  4. Fetch Malaysian subtitle on same media.
  5. Play and observe selection

Expected behavior Findroid should pick Indonesian even if Malaysian subtitle exist.

Screenshots If applicable, add screenshots to help explain your problem.

see comments

Device info (please complete the following information):

Additional context Using mpv with mediacodec-copy and gpu option

nattadasu commented 3 months ago

Following is steps to replicate the issue, forgot to attach it: https://github.com/user-attachments/assets/359df425-424d-4c6c-9d14-c4dd36c52160

nattadasu commented 3 months ago

Update: Findroid will not select Indonesian if default video subtitle is English and does not have Malay subtitle

https://github.com/user-attachments/assets/e40c3d5d-ffc0-4036-be92-6980078e2d8d

It seems that there's weird issue between Findroid and the player when communicating which subtitle to select, and prioritized Malaysian instead

jarnedemeulemeester commented 3 months ago

Added the same fix before passing the language code to mpv as done for the selection dialog. mpv should now correctly select Indonesia