mpv
mpv copied to clipboard
scripts loading twice when mpv folder in appdata
mpv Information
mpv v0.38.0-556-g95ac3222 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
built on Jun 25 2024 04:06:53
libplacebo version: v7.349.0 (v7.349.0-rc1-3-g1fd3c7b-dirty)
FFmpeg version: N-116015-g23531c977
FFmpeg library versions:
libavcodec 61.8.100
libavdevice 61.2.100
libavfilter 10.2.102
libavformat 61.4.100
libavutil 59.26.100
libswresample 5.2.100
libswscale 8.2.100
Other Information
- Windows version: Windows 10, 19044.4412
- GPU model, driver and version: VM
- Source of mpv: https://github.com/zhongfly/mpv-winbuild/releases/latest
- Introduced in version: don't know
Reproduction Steps
download mpv
extract to %appdata%
rename folder to mpv
create scripts folder
create a new file inside scripts folder (use anything other than .lua)
open mpv
Expected Behavior
scripts load once
Actual Behavior
scripts are loaded twice
[ 0.017][e][cplayer] Can't load unknown script: C:/Users/Test/AppData/Roaming/mpv/scripts/only1script.txt
[ 0.017][e][cplayer] Can't load unknown script: C:\Users\Test\AppData\Roaming/mpv/scripts/only1script.txt
Log File
Sample Files
No response
I carefully read all instruction and confirm that I did the following:
- [X] I tested with the latest mpv version to validate that the issue is not already fixed.
- [X] I provided all required information including system and mpv version.
- [X] 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. - [X] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
- [X] I attached the full, untruncated log file.
- [X] I attached the backtrace in the case of a crash.
how I found this bug:
I have a script that does ALT+TAB and when I placed mpv folder in %appdata% it would do it twice,
log file also shows that not only scripts are loaded twice.
https://mpv.io/manual/master/#files-on-windows
Config files located in the same directory as mpv.exe are loaded with lower priority. Some config files are loaded only once, which means that e.g. of 2 input.conf files located in two config directories, only the one from the directory with higher priority will be loaded.
A third config directory with the lowest priority is the directory named mpv in the same directory as mpv.exe. This used to be the directory with the highest priority, but is now discouraged to use and might be removed in the future.
I am aware of the fact that mpv searches for a few directories (as can easily be observed in the log file),
but I don't think we are on the same page here,
I'm talking about the fact that mpv executes the same script twice, even though there's only one directory of mpv and that's in %appdata%.
mpv will search for the /script near mpv.exe and /script in appdata.
Two conf dirs in your case.
I'll be honest, I am quite confused, is it possible we have a misunderstanding?
What I'm explaining in this issue is that I have one instance of mpv installed, which is in %appdata%, I also have a one script that does ALT+TAB, the result of which is mpv executes this script twice.
mpv will search for the /script near mpv.exe and /script in appdata.
So because mpv is in the same folder that it searches for (%appdata%) - it loads the same scripts twice? Isn't it quite flawed?
There is no reason to install a software in its conf dir.
I do not see a problem here. If you move mpv.exe to anywhere else and keep the same script both in two /script , it will be loaded "twice" too.
The same problem, mpv had to be moved to Program Files. Now the scripts are loaded once. It was quite convenient to have mpv.exe in appdata, I could immediately copy everything with configs.