Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
autoload.lua Loads files incorrectly and behaves erratically #5618
mpv version and platform
mpv 0.28.0 on Windows 10 x64
Have autoload.lua active and place video files in a folder with different names and extensions, for example:
Video files would play one after the other, in order.
Random order of playing, and the same files are appended over and over to the playlist if you keep triggering "play next" a few times. So let's say the folder contains 300 video files, with "play next" a few times, it plays in random order or completely restarts order, then the playlist will indicate that it now contains 600 entries, then 900 and so on.
I keep track of playlist by displaying
Currently using the latest stable release of autoload.lua, unmodified.
The reason I listed examples of the filenames is because I'm not really sure what's causing the problem, different extensions, specific characters used in filenames, the number of files or a mixture of all.
I've tried to represent some of the weird filenames exactly because there are definitely weirdly named files in there, though the total files is 305 in one of my folders, but it occurs in other folders as well with more files.
Ah, my bad.
Here is an update. I have a folder with 64 video files, the name syntax is normal. Example:
Same behavior as I mentioned earlier, all with the same file extension and normal file names.
Preview of behavior: (Screen Capture - MP4 - 1.7 MB)
As you can see from the preview, when I playnext on 03 it starts 03 again and the playlist becomes bigger, if I keep triggering play next a few times, same thing happens again.
Just wanted to add a note, this behavior isn't constant in all folders. By that I mean, in other folders/files it behaves normally.
Not sure if that would be of any help identifying the issue.
Also tested on Debian Stretch, mpv 0.27.2 (deb-multimedia). Same behavior. Can upload screen capture for this as well if needed.
It is, yes. Since you implied it could be a network mount issue, I copied that folder to my E: drive (HDD), and the problem didn't occur. Everything works well.
I guess this happens over network mounts. (tested on Windows 10 and Debian Stretch)
Any suggested solution? Or do you need me to provide more information?
The behavior is really odd. When I start the first file, the playlist only consists of that file (1/1). When I trigger play next the playlist then gets generated correctly in the correct position (2/64).
When I reach the third file (fourth on Linux) the playlist gets bigger, from 64 to 128, 187 and so on.
I wonder if it's because you move to the next playlist item before the script finishes. It takes a whole second to run
Aha. You are absolutely right. I tested with the latest autoload.lua you posted and the unmodified stable one, works on both.
Waiting 3-4 seconds between each file before triggering "play next" makes autoload.lua behave normally.
I have no idea if this matters, but I'm on a Gigabit network, read/write speeds from that NAS averages around 600Mbps (60MB). Does that mean I need to find a way to optimize my mounts specifically for mpv/autoload.lua?