--autocreate-playlist plays wrong file when filename differs in unicode or case

Open
#18,765 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c, macos
Domain
backend

Research direction

Start by tracing how --autocreate-playlist identifies and compares paths, then inspect the related file search and saved-position handling mentioned in the issue. The report describes several affected behaviors but does not name source files or tests, and points to a deeper file identity design problem. Done means the requested path plays correctly on filesystems that normalize Unicode or ignore case, without breaking the other reported behaviors.

Written by the indexing model from the issue text.

Description

os:mac
mpv Information
mpv v0.42.0 Copyright © 2000-2026 mpv/MPlayer/mplayer2 projects
 built on Nov  5 2026 00:13:11
libplacebo version: v7.387.0 (v7.387.0-11-g0e435227-dirty)
FFmpeg version: N-128420-gbaa68e68b3
FFmpeg library versions:
   libavcodec      63.26.100
   libavdevice     63.6.100
   libavfilter     12.12.100
   libavformat     63.18.100
   libavutil       61.20.100
   libswresample   7.7.100
   libswscale      10.6.100
Other Information
- macOS version:macOS 15.8.2 (24H232)
- Source of mpv:github
- Latest known working version:unknown
- The time when the problem started to happen:noticed on 0.42.0
Reproduction Steps

I was investigating why double clicking a file in macos' finder with katakana in its basename, together with --autocreate-playlist, was opening the wrong file.

I figured out it had to do with ザ being in the filename in composed unicode form.
for example:

# が in two forms: composed U+304C, decomposed U+304B U+3099.
composed=$(printf '\343\201\214')
decomposed=$(printf '\343\201\213\343\202\231')

# create two identical videos
mpv --no-config --ao=null av://lavfi:testsrc=d=0.2 --o=a.mkv
cp a.mkv "$composed.mkv"

# both are the same file (inode is identical)
stat -f %i "$composed.mkv" "$decomposed.mkv"

mpv --no-config --vo=null --ao=null --autocreate-playlist=filter "$composed.mkv"
# Playing: .../が.mkv

mpv --no-config --vo=null --ao=null --autocreate-playlist=filter "$decomposed.mkv"
# Playing: .../a.mkv
# Playing: .../が.mkv

then I realised this is not specific to unicode. casefolding file systems outsided of macos are probably affected too.

# on a case-insensitive fs, with a.mkv and b.mkv in the directory
mpv --no-config --autocreate-playlist=filter B.mkv
# Playing: .../a.mkv
# Playing: .../b.mkv

the attached log is from the "$decomposed" command.

the underlying issue seems to be a deeper one: mpv treats a path string as the file identity, which is arguably incorrect.

some examples of what this leads to in 0.42:

  • the wrong file plays with --autocreate-playlist
  • one file gets two saved positions, e.g. via b.mkv and B.mkv
  • mpv --sub-file=b.srt b.mkv shows b.srt as two subtitle tracks

and possibly others. all of this was tested only on macos with APFS.

related, as far as I can tell:

  • #1027 (2014): closed as a macos problem
  • #4016, #4067 (2017): fixed only for file search
  • #495, #12303 (2014, 2024): saved positions, partially fixed
Expected Behavior

the opened file plays

Actual Behavior

the first file in the directory plays instead (or the first one with a saved position)

Log File

output.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:
  • I tested and confirmed that the issue exists with the latest release version or newer.
  • 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.
Dominant language
C
Stars
38.2k
Forks
3.7k
Avg merge
1d 13h
Merged PRs (30d)
76

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mpv-player/mpv

All issues in mpv-player/mpv

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.