Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpv attempts to parse language tags from video filename for the external track file with the same name #16038

Open
6 tasks done
dyphire opened this issue Mar 11, 2025 · 0 comments · May be fixed by #16040
Open
6 tasks done

Comments

@dyphire
Copy link
Contributor

dyphire commented Mar 11, 2025

mpv Information

mpv v0.39.0-1016-g4c26e7d2e Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Mar 10 2025 17:10:23
libplacebo version: v7.350.0 (v7.349.0-47-gd9ec2b4-dirty)
FFmpeg version: N-118728-g04d7a6d3d
FFmpeg library versions:
   libavcodec      61.33.102
   libavdevice     61.4.100
   libavfilter     10.9.100
   libavformat     61.9.107
   libavutil       59.59.100
   libswresample   5.4.100
   libswscale      8.13.101

Other Information

- Windows version: Win11 24H2
- GPU model, driver and version:
- Source of mpv: git master
- Latest known working version: n/a
- Issue started after the following happened: n/a

Reproduction Steps

Try using mpv --no-config --log-file=mpv.log to play a video with the same name external track file and view external track information.

Expected Behavior

External track files with the same name as the video file name should not show any available language tags

Actual Behavior

mpv attempts to parse language tags from video filename for the external track file with the same name

[   4.138][v][cplayer] Opening done: G:\TV\[神探狄仁杰Ⅰ].Detective.Dee.2004.S01.Complete.WEB-DL.1080p.H264.AAC-CMCTV\[神探狄仁杰Ⅰ].Detective.Dee.2004.S01.Ep01.WEB-DL.1080p.H264.AAC-CMCTV.mp4
[   4.138][v][find_files] Loading external files in G:\TV\[神探狄仁杰Ⅰ].Detective.Dee.2004.S01.Complete.WEB-DL.1080p.H264.AAC-CMCTV\
[   4.138][v][ifo_dvdnav] Opening G:\TV\[神探狄仁杰Ⅰ].Detective.Dee.2004.S01.Complete.WEB-DL.1080p.H264.AAC-CMCTV\[神探狄仁杰Ⅰ].Detective.Dee.2004.S01.Ep01.WEB-DL.1080p.H264.AAC-CMCTV.ass
[   4.138][v][bdmv/bluray] Opening G:\TV\[神探狄仁杰Ⅰ].Detective.Dee.2004.S01.Complete.WEB-DL.1080p.H264.AAC-CMCTV\[神探狄仁杰Ⅰ].Detective.Dee.2004.S01.Ep01.WEB-DL.1080p.H264.AAC-CMCTV.ass
[   4.138][v][file] Opening G:\TV\[神探狄仁杰Ⅰ].Detective.Dee.2004.S01.Complete.WEB-DL.1080p.H264.AAC-CMCTV\[神探狄仁杰Ⅰ].Detective.Dee.2004.S01.Ep01.WEB-DL.1080p.H264.AAC-CMCTV.ass
...
[   4.150][i][cplayer] ● Video  --vid=1                     (h264 1920x1080 25 fps) [default]
[   4.150][i][cplayer] ● Audio  --aid=1                     (aac 2ch 44100 Hz 152 kbps) [default]
[   4.150][i][cplayer] ● Subs   --sid=1  --slang=AAC-CMCTV  'ass' (ass) [external]

Log File

mpv.log

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@dyphire dyphire added the os:win label Mar 11, 2025
@Dudemanguy Dudemanguy added this to the Release v0.40.0 milestone Mar 11, 2025
Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Mar 11, 2025
The old logic blindly accepted any string combination that had the same
format as an IETF. Do at least a little bit of validation to make sure
the first part matches an actual language. The downside is that this
requires having a giant whitelist of language tags. But it's not like
the amount of languages on planet earth is growing at a rapid pace or
something. ISO 639-2 is choosen since we already canonicalize to that
and ISO 639-3 is just overkill. Fixes mpv-player#16038.
Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Mar 11, 2025
The old logic blindly accepted any string combination that had the same
format as an IETF. Do at least a little bit of validation to make sure
the first part matches an actual language. The downside is that this
requires having a giant whitelist of language tags. But it's not like
the amount of languages on planet earth is growing at a rapid pace or
something. ISO 639-2 is chosen since we already canonicalize to that and
ISO 639-3 is just overkill. Fixes mpv-player#16038.
Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Mar 11, 2025
The old logic blindly accepted any string combination that had the same
format as an IETF. Do at least a little bit of validation to make sure
the first part matches an actual language. The downside is that this
requires having a giant whitelist of language tags. But it's not like
the amount of languages on planet earth is growing at a rapid pace or
something. Living languages with ISO 639-2 tags are chosen as the basis
of the whitelist since we accept those and having a list of everything
in ISO 639-3 is just overkill. Fixes mpv-player#16038.
Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Mar 11, 2025
The old logic blindly accepted any string combination that had the same
format as an IETF. Do at least a little bit of validation to make sure
the first part matches an actual language. The downside is that this
requires having a giant whitelist of language tags. But it's not like
the amount of languages on planet earth is growing at a rapid pace or
something. Living languages with ISO 639-2 tags are chosen as the basis
of the whitelist since we accept those and having a list of everything
in ISO 639-3 is just overkill. Fixes mpv-player#16038.
Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Mar 11, 2025
The old logic blindly accepted any string combination that had the same
format as an IETF. Do at least a little bit of validation to make sure
the first part matches an actual language. The downside is that this
requires having a giant whitelist of language tags. But it's not like
the amount of languages on planet earth is growing at a rapid pace or
something. Living languages with ISO 639-2 tags are chosen as the basis
of the whitelist since we accept those and having a list of everything
in ISO 639-3 is just overkill. Fixes mpv-player#16038.
Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Mar 12, 2025
The old logic blindly accepted any string combination that had the same
format as an IETF. Do at least a little bit of validation to make sure
the first part matches an actual language. The downside is that this
requires having a giant whitelist of language tags. But it's not like
the amount of languages on planet earth is growing at a rapid pace or
something. Living languages with ISO 639-2 tags are chosen as the basis
of the whitelist since we accept those and having a list of everything
in ISO 639-3 is just overkill. Fixes mpv-player#16038.
Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Mar 12, 2025
The old logic blindly accepted any string combination that had the same
format as an IETF. Do at least a little bit of validation to make sure
the first part matches an actual language. The downside is that this
requires having a giant whitelist of language tags. But it's not like
the amount of languages on planet earth is growing at a rapid pace or
something. Living languages with ISO 639-2 tags are chosen as the basis
of the whitelist since we accept those and having a list of everything
in ISO 639-3 is just overkill. As a side note, Chinese should
canonicalize to zho not chi so change that as well.

Fixes mpv-player#16038.
Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Mar 12, 2025
The old logic blindly accepted any string combination that had the same
format as an IETF. Do at least a little bit of validation to make sure
the first part matches an actual language. The downside is that this
requires having a giant whitelist of language tags. But it's not like
the amount of languages on planet earth is growing at a rapid pace or
something. Living languages with ISO 639-2 tags are chosen as the basis
of the whitelist since we accept those and having a list of everything
in ISO 639-3 is just overkill.

Fixes mpv-player#16038.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants