Skip to content

--shuffle switch position changes directory parsing mode #17601

@tkzv

Description

@tkzv

mpv Information

mpv v0.41.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.360.0
FFmpeg version: 8.0.1
FFmpeg library versions:
   libavcodec      62.11.100
   libavdevice     62.1.100
   libavfilter     11.4.100
   libavformat     62.3.100
   libavutil       60.8.100
   libswresample   6.1.100
   libswscale      9.1.100

Other Information

- Linux version: 
NAME=Gentoo
PRETTY_NAME="Gentoo Linux"

- Kernel Version:
Linux jet 6.12.41-gentoo #4 SMP PREEMPT_DYNAMIC Fri Dec 26 10:22:14 MSK 2025 x86_64 AMD Ryzen 9 9950X3D 16-Core Processor AuthenticAMD GNU/Linux

- GPU Model:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GB202 [GeForce RTX 5090] [10de:2b85] (rev a1)
0e:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Granite Ridge [Radeon Graphics] [1002:13c0] (rev c9)

- Mesa/GPU Driver Version:
glxinfo -B | grep "OpenGL version string"
OpenGL version string: 4.6.0 NVIDIA 590.44.01

- Window Manager and Version:
kwin 6.5.5

- Source of mpv:
compiled with Gentoo tools from official source code 

- Latest known working version:

- Issue started after the following happened:

Reproduction Steps

  1. Place several media files in folders with complex structure, for example:
    dir1/1.mp3
    dir1/2/3.mp3
    dir1/2/4.mp3
    dir1/5.mp3
    dir2/6.mp3
    dir2/7/8.mp3
    dir4/9.mp3

  2. Run mpv --shuffle --playlist=dir1 --playlist=dir2, press Ctrl-P, select "Playlist" — all media files are visible, in random order. This is correct.

  3. Run mpv --playlist=dir1 --playlist=dir2 --shuffle, press Ctrl-P, select "Playlist" — only the top level files are visible, the directories "2" and "7" were not processed.

Expected Behavior

Default --directory-mode=auto should process playlists as "recursive", when --shuffle is present.

Actual Behavior

When --shuffle is at the start of the command line, the playlists are correctly processed in "recursive" mode. When --shuffle is at the end, the mode is "lazy" — the directories are read and shuffled only when player reaches them. Everything is added to the same place in the list, which mostly defeats the purpose of shuffling.

Adding explicit --directory-mode=auto to the command line does not change this behavior. Adding --directory-mode=recursive works correctly.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions