mpv does not use natural sort order for directory entries

Created on 25 Jul 2018  路  18Comments  路  Source: mpv-player/mpv

mpv version and platform

$ mpv --version
mpv 0.28.2 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       56.14.100
   libavcodec      58.18.100
   libavformat     58.12.100
   libswscale      5.1.100
   libavfilter     7.16.100
   libswresample   3.1.100
ffmpeg version: 4.0.2-1

Reproduction steps

Just playing mpv . so a playlist is generated and it goes from 1 to whatever number is in sequence.

Expected behavior

The files should play in sequence.

Actual behavior

$ mpv . 
Playing: .
[file] This is a directory - adding to playlist.

Playing: ./Horn OK Please - S01 E01 - [MovCr.com].mkv
 (+) Video --vid=1 (*) 'www.MovCr.com' (h264 1280x720 25.000fps)
     Audio --aid=1 --alang=tam 'www.MovCr.com' (aac 2ch 96000Hz)
     Audio --aid=2 --alang=tel 'www.MovCr.com' (aac 2ch 96000Hz)
     Audio --aid=3 --alang=mal 'www.MovCr.com' (aac 2ch 96000Hz)
 (+) Audio --aid=4 --alang=hin (*) (f) 'www.MovCr.com' (aac 2ch 96000Hz)
File tags:
 Title: www.MovCr.com
AO: [pulse] 96000Hz stereo 2ch float
VO: [gpu] 1280x720 yuv420p10
AV: 00:18:32 / 00:18:32 (99%) A-V:  0.000

Playing: ./Horn OK Please - S01 E010 - [MovCr].mkv
 (+) Video --vid=1 (*) 'www.MovCr.com' (h264 1280x720 25.000fps)
     Audio --aid=1 --alang=tam 'www.MovCr.com' (aac 2ch 96000Hz)
     Audio --aid=2 --alang=tel 'www.MovCr.com' (aac 2ch 96000Hz)
     Audio --aid=3 --alang=mal 'www.MovCr.com' (aac 2ch 96000Hz)
 (+) Audio --aid=4 --alang=hin (*) (f) 'www.MovCr.com' (aac 2ch 96000Hz)
File tags:
 Title: www.MovCr.com
(Paused) AV: 00:00:02 / 00:22:03 (0%) A-V:  0.000
[input] No key binding found for key 'END'.
(Paused) AV: 00:00:02 / 00:22:03 (0%) A-V:  0.000
Saving state.

Exiting... (Quit)

The directory has 12 files, it should be doing it in sequence as it usually does, but in the above it does not. This is how the directory looks -

$ ls
'Horn OK Please - S01 E010 - [MovCr].mkv'     'Horn OK Please - S01 E05 - [MovCr].mkv'
'Horn OK Please - S01 E011 - [MovCr].mkv'     'Horn OK Please - S01 E06 - [MovCr].mkv'
'Horn OK Please - S01 E012 - [MovCr].mkv'     'Horn OK Please - S01 E07  - [MovCr].mkv'
'Horn OK Please - S01 E01 - [MovCr.com].mkv'  'Horn OK Please - S01 E08 - [MovCr].mkv'
'Horn OK Please - S01 E02 - [MovCr.com].mkv'  'Horn OK Please - S01 E09 - [MovCr].mkv'
'Horn OK Please - S01 E03 - [MovCr].mkv'       www.MovCr.com.txt
'Horn OK Please - S01 E04 - [MovCr].mkv'```

Log file

I am attaching the limited log file, although would be nice to have an option to see how mpv sequences the playlist.

Edit: Tried to attach a log file with .txt but apparently github doesn't allow hence used https://pastebin.com/9uAtJgx0

All 18 comments

That is the correct sort order though.

@j605 well, in that case can something be done to improve the sort order. I do see the whole https://manpages.debian.org/testing/mpv/mpv.1.en.html#Escaping_spaces_and_other_special_characters but unable to parse how I could achieve the sequencing I want, can you help ?

Rename 01...09 to 001...009

Or 010...012 to 10...12 should do as well.

Most if not all players would do the same thing as mpv.. if you don't want to rename you could create a .m3u in the video dir. and use that for mpv.
ls -1v |grep .mkv > /tmp/1.m3u && mv /tmp/1.m3u .

Most if not all players would do the same thing as mpv

That's besides the point. The point is that the default sort appears to be alphanumeric, while arguably most users would expect a natural sort order (e.g. where 2 comes before 12).

Depending on your point of view it's a feature request or a bug, but regardless, it's not an unreasonable expectation.

Is it really mpv performing or determining the sort logic, though? Or is it just passed through to the sys calls handled by the OS and spat out without special handling?

At least for Windows, doing natural sort seems to be possible by invoking StrCmpLogicalW. I'm not sure what it would be in *nix.

@mc4man, that one was actually better than expected.

$ cat 1.m3u
-rw-r--r-- 1 shirish shirish 108760433 Jul 14 18:16 Horn OK Please - S01 E01 - [MovCr.com].mkv
-rw-r--r-- 1 shirish shirish 134845570 Jul 14 18:34 Horn OK Please - S01 E02 - [MovCr.com].mkv
-rw-r--r-- 1 shirish shirish 129760149 Jul 14 18:38 Horn OK Please - S01 E03 - [MovCr].mkv
-rw-r--r-- 1 shirish shirish 130052887 Jul 14 18:42 Horn OK Please - S01 E04 - [MovCr].mkv
-rw-r--r-- 1 shirish shirish 146355222 Jul 14 18:46 Horn OK Please - S01 E05 - [MovCr].mkv
-rw-r--r-- 1 shirish shirish 130040230 Jul 14 18:50 Horn OK Please - S01 E06 - [MovCr].mkv
-rw-r--r-- 1 shirish shirish 136089287 Jul 14 18:54 Horn OK Please - S01 E07  - [MovCr].mkv
-rw-r--r-- 1 shirish shirish 135047083 Jul 14 18:58 Horn OK Please - S01 E08 - [MovCr].mkv
-rw-r--r-- 1 shirish shirish 131699570 Jul 14 19:01 Horn OK Please - S01 E09 - [MovCr].mkv
-rw-r--r-- 1 shirish shirish 129422442 Jul 14 18:22 Horn OK Please - S01 E010 - [MovCr].mkv
-rw-r--r-- 1 shirish shirish 113695765 Jul 14 18:26 Horn OK Please - S01 E011 - [MovCr].mkv
-rw-r--r-- 1 shirish shirish 125595158 Jul 14 18:30 Horn OK Please - S01 E012 - [MovCr].mkv

But playing it went into the same issues -

$ mpv . --no-resume-playback
Playing: .
[file] This is a directory - adding to playlist.

Playing: ./1.m3u

Playing: ./-rw-r--r-- 1 shirish shirish 108760433 Jul 14 18:16 Horn OK Please - S01 E01 - [MovCr.com].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 108760433 Jul 14 18:16 Horn OK Please - S01 E01 - [MovCr.com].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 108760433 Jul 14 18:16 Horn OK Please - S01 E01 - [MovCr.com].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 134845570 Jul 14 18:34 Horn OK Please - S01 E02 - [MovCr.com].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 134845570 Jul 14 18:34 Horn OK Please - S01 E02 - [MovCr.com].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 134845570 Jul 14 18:34 Horn OK Please - S01 E02 - [MovCr.com].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 129760149 Jul 14 18:38 Horn OK Please - S01 E03 - [MovCr].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 129760149 Jul 14 18:38 Horn OK Please - S01 E03 - [MovCr].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 129760149 Jul 14 18:38 Horn OK Please - S01 E03 - [MovCr].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 130052887 Jul 14 18:42 Horn OK Please - S01 E04 - [MovCr].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 130052887 Jul 14 18:42 Horn OK Please - S01 E04 - [MovCr].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 130052887 Jul 14 18:42 Horn OK Please - S01 E04 - [MovCr].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 146355222 Jul 14 18:46 Horn OK Please - S01 E05 - [MovCr].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 146355222 Jul 14 18:46 Horn OK Please - S01 E05 - [MovCr].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 146355222 Jul 14 18:46 Horn OK Please - S01 E05 - [MovCr].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 130040230 Jul 14 18:50 Horn OK Please - S01 E06 - [MovCr].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 130040230 Jul 14 18:50 Horn OK Please - S01 E06 - [MovCr].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 130040230 Jul 14 18:50 Horn OK Please - S01 E06 - [MovCr].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 136089287 Jul 14 18:54 Horn OK Please - S01 E07  - [MovCr].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 136089287 Jul 14 18:54 Horn OK Please - S01 E07  - [MovCr].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 136089287 Jul 14 18:54 Horn OK Please - S01 E07  - [MovCr].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 135047083 Jul 14 18:58 Horn OK Please - S01 E08 - [MovCr].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 135047083 Jul 14 18:58 Horn OK Please - S01 E08 - [MovCr].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 135047083 Jul 14 18:58 Horn OK Please - S01 E08 - [MovCr].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 131699570 Jul 14 19:01 Horn OK Please - S01 E09 - [MovCr].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 131699570 Jul 14 19:01 Horn OK Please - S01 E09 - [MovCr].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 131699570 Jul 14 19:01 Horn OK Please - S01 E09 - [MovCr].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 129422442 Jul 14 18:22 Horn OK Please - S01 E010 - [MovCr].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 129422442 Jul 14 18:22 Horn OK Please - S01 E010 - [MovCr].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 129422442 Jul 14 18:22 Horn OK Please - S01 E010 - [MovCr].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 113695765 Jul 14 18:26 Horn OK Please - S01 E011 - [MovCr].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 113695765 Jul 14 18:26 Horn OK Please - S01 E011 - [MovCr].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 113695765 Jul 14 18:26 Horn OK Please - S01 E011 - [MovCr].mkv.

Playing: ./-rw-r--r-- 1 shirish shirish 125595158 Jul 14 18:30 Horn OK Please - S01 E012 - [MovCr].mkv
[file] Cannot open file './-rw-r--r-- 1 shirish shirish 125595158 Jul 14 18:30 Horn OK Please - S01 E012 - [MovCr].mkv': No such file or directory
Failed to open ./-rw-r--r-- 1 shirish shirish 125595158 Jul 14 18:30 Horn OK Please - S01 E012 - [MovCr].mkv.

Playing: ./Horn OK Please - S01 E01 - [MovCr.com].mkv
 (+) Video --vid=1 (*) 'www.MovCr.com' (h264 1280x720 25.000fps)
     Audio --aid=1 --alang=tam 'www.MovCr.com' (aac 2ch 96000Hz)
     Audio --aid=2 --alang=tel 'www.MovCr.com' (aac 2ch 96000Hz)
     Audio --aid=3 --alang=mal 'www.MovCr.com' (aac 2ch 96000Hz)
 (+) Audio --aid=4 --alang=hin (*) (f) 'www.MovCr.com' (aac 2ch 96000Hz)
File tags:
 Title: www.MovCr.com
AO: [pulse] 96000Hz stereo 2ch float
VO: [gpu] 1280x720 yuv420p10
AV: 00:18:32 / 00:18:32 (100%) A-V:  0.000

Playing: ./Horn OK Please - S01 E010 - [MovCr].mkv
 (+) Video --vid=1 (*) 'www.MovCr.com' (h264 1280x720 25.000fps)
     Audio --aid=1 --alang=tam 'www.MovCr.com' (aac 2ch 96000Hz)
     Audio --aid=2 --alang=tel 'www.MovCr.com' (aac 2ch 96000Hz)
     Audio --aid=3 --alang=mal 'www.MovCr.com' (aac 2ch 96000Hz)
 (+) Audio --aid=4 --alang=hin (*) (f) 'www.MovCr.com' (aac 2ch 96000Hz)
File tags:
 Title: www.MovCr.com
AV: 00:00:09 / 00:22:03 (0%) A-V: -0.001
Saving state.

For some unknown reason, it is unable to parse or/and use the derived .m3u playlist :(

I for one wouldn't like to rename files unless it's the last option.

@qyot27 It is mpv doing the sorting. It's just a qsort comparing with strcmp. See 1d36955f70d27b5de6d323f23b94034221db0890.

It's about as basic as it could be -- it's pretty much only meaningful on ASCII filenames. Replacing the strcmp with custom logic to naturally sort ASCII numbers would be easy enough.

I don't think C stdlib has an equivalent to the Windows function you mentioned. Back here in 1970 we treat everything as bytes. The closest might be strcoll, which at least makes an attempt at locale-awareness, but it doesn't do numbers naturally and since mpv insists on C locale it wouldn't really do anything for us. Unicode sorting would be hard because we don't even know what encoding our filenames are in (if any!) but sorting ASCII numbers and doing the rest by binary is probably enough. Generally, people are going to want episodes or tracks in order, with everything before the number being identical; they're not likely to care about alphabetical ordering of random files.

@shirishag75 Regarding the actual filenames in the OP, whoever made those files appears to have been in a hurry or very confused. The entire point of zero-padding in this situation is to prevent exactly this issue with lexicographic sorting. 01, 02, ..., 09, 010 -- seriously? It looks like it was an attempt at zero-padding, but it's actually zero-prepending-for-absolutely-no-reason. Natural sorting would handle them correctly anyway, but lexicographically they're no different from 1, 2, ..., 9, 10. Not that that has any impact on the bug / feature request, I guess.

About the m3u thing, it looks like you used an l (lowercase L) instead of a 1 (numeral one). Also, you should play the m3u file instead of ..

About the m3u thing, it looks like you used an l (lowercase L) instead of a 1 (numeral one). Also, you should play the m3u file instead of ..

I tried the following -

$ mv 1.m3u 1.m3u
mv: '1.m3u' and '1.m3u' are the same file

I had actually tried playing the .m3u playlist but got this -

$ mpv 1.m3u 
Playing: 1.m3u

Playing: -rw-r--r-- 1 shirish shirish 108760433 Jul 14 18:16 Horn OK Please - S01 E01 - [MovCr.com].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 108760433 Jul 14 18:16 Horn OK Please - S01 E01 - [MovCr.com].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 108760433 Jul 14 18:16 Horn OK Please - S01 E01 - [MovCr.com].mkv.

Playing: -rw-r--r-- 1 shirish shirish 134845570 Jul 14 18:34 Horn OK Please - S01 E02 - [MovCr.com].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 134845570 Jul 14 18:34 Horn OK Please - S01 E02 - [MovCr.com].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 134845570 Jul 14 18:34 Horn OK Please - S01 E02 - [MovCr.com].mkv.

Playing: -rw-r--r-- 1 shirish shirish 129760149 Jul 14 18:38 Horn OK Please - S01 E03 - [MovCr].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 129760149 Jul 14 18:38 Horn OK Please - S01 E03 - [MovCr].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 129760149 Jul 14 18:38 Horn OK Please - S01 E03 - [MovCr].mkv.

Playing: -rw-r--r-- 1 shirish shirish 130052887 Jul 14 18:42 Horn OK Please - S01 E04 - [MovCr].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 130052887 Jul 14 18:42 Horn OK Please - S01 E04 - [MovCr].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 130052887 Jul 14 18:42 Horn OK Please - S01 E04 - [MovCr].mkv.

Playing: -rw-r--r-- 1 shirish shirish 146355222 Jul 14 18:46 Horn OK Please - S01 E05 - [MovCr].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 146355222 Jul 14 18:46 Horn OK Please - S01 E05 - [MovCr].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 146355222 Jul 14 18:46 Horn OK Please - S01 E05 - [MovCr].mkv.

Playing: -rw-r--r-- 1 shirish shirish 130040230 Jul 14 18:50 Horn OK Please - S01 E06 - [MovCr].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 130040230 Jul 14 18:50 Horn OK Please - S01 E06 - [MovCr].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 130040230 Jul 14 18:50 Horn OK Please - S01 E06 - [MovCr].mkv.

Playing: -rw-r--r-- 1 shirish shirish 136089287 Jul 14 18:54 Horn OK Please - S01 E07  - [MovCr].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 136089287 Jul 14 18:54 Horn OK Please - S01 E07  - [MovCr].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 136089287 Jul 14 18:54 Horn OK Please - S01 E07  - [MovCr].mkv.

Playing: -rw-r--r-- 1 shirish shirish 135047083 Jul 14 18:58 Horn OK Please - S01 E08 - [MovCr].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 135047083 Jul 14 18:58 Horn OK Please - S01 E08 - [MovCr].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 135047083 Jul 14 18:58 Horn OK Please - S01 E08 - [MovCr].mkv.

Playing: -rw-r--r-- 1 shirish shirish 131699570 Jul 14 19:01 Horn OK Please - S01 E09 - [MovCr].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 131699570 Jul 14 19:01 Horn OK Please - S01 E09 - [MovCr].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 131699570 Jul 14 19:01 Horn OK Please - S01 E09 - [MovCr].mkv.

Playing: -rw-r--r-- 1 shirish shirish 129422442 Jul 14 18:22 Horn OK Please - S01 E010 - [MovCr].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 129422442 Jul 14 18:22 Horn OK Please - S01 E010 - [MovCr].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 129422442 Jul 14 18:22 Horn OK Please - S01 E010 - [MovCr].mkv.

Playing: -rw-r--r-- 1 shirish shirish 113695765 Jul 14 18:26 Horn OK Please - S01 E011 - [MovCr].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 113695765 Jul 14 18:26 Horn OK Please - S01 E011 - [MovCr].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 113695765 Jul 14 18:26 Horn OK Please - S01 E011 - [MovCr].mkv.

Playing: -rw-r--r-- 1 shirish shirish 125595158 Jul 14 18:30 Horn OK Please - S01 E012 - [MovCr].mkv
[file] Cannot open file '-rw-r--r-- 1 shirish shirish 125595158 Jul 14 18:30 Horn OK Please - S01 E012 - [MovCr].mkv': No such file or directory
Failed to open -rw-r--r-- 1 shirish shirish 125595158 Jul 14 18:30 Horn OK Please - S01 E012 - [MovCr].mkv.

I am still willing to play around provided somebody is able to explain me what am I doing wrong ?

The name of the m3u doesn't matter. It's the ls command. @mc4man posted ls -1v (numeral one) but your results make it look like you did ls -lv (lowercase L). That's what's responsible for the extra junk in your playlist file that's making mpv not find the files.

my bad, we all live and learn. Guess I can close this bug now :)

Well, we could still sort naturally.

e.g.

diff --git a/demux/demux_playlist.c b/demux/demux_playlist.c
index 3a65ada451..c3d5fdd09e 100644
--- a/demux/demux_playlist.c
+++ b/demux/demux_playlist.c
@@ -283,7 +283,31 @@ static bool scan_dir(struct pl_parser *p, char *path,

 static int cmp_filename(const void *a, const void *b)
 {
-    return strcmp(*(char **)a, *(char **)b);
+    char *name1 = *(char **)a, *name2 = *(char **)b;
+    char *end1 = name1, *end2 = name2;
+    while (*name1 && *name2) {
+        if (*name1 >= '0' && *name1 <= '9' && *name2 >= '0' && *name2 <= '9' &&
+            name1 >= end1 && name2 >= end2)
+        {
+            long num1 = strtol(name1, &end1, 10);
+            long num2 = strtol(name2, &end2, 10);
+            if (num1 < num2)
+                return -1;
+            if (num1 > num2)
+                return 1;
+        }
+        if (*name1 < *name2)
+            return -1;
+        if (*name1 > *name2)
+            return 1;
+        name1++;
+        name2++;
+    }
+    if (*name2)
+        return -1;
+    if (*name1)
+        return 1;
+    return 0;
 }

 static int parse_dir(struct pl_parser *p)

(that doesn't handle .5 or anything)

Is there any reason not to do natural sorting?

+            if (num1 < num2)
+                return -1;
+            if (num1 > num2)
+                return 1;
+        }

I'd also add inside this clause:

        name1 = end1; name2 = end2 ; continue;

or else s01e3 would be categorize before s1e2, which IMO is undesirable (at the expense that leading zeroes would count for nothing, but I think it's a good tradeoff for this specific use case).

+        if (*name1 < *name2)
+            return -1;
+        if (*name1 > *name2)
+            return 1;

I'd use tolower to make it also case insensitive while you're at it, and probably isdigit instead of the digits range checks earlier - the compiler is unlikely IMO to produce slower code than yours.

Both the leading zeroes and the case insensitivity changes would make it a non deterministic sort, but I still think it's well worth it for this use case.

I'd also add inside this clause:

    name1 = end1; name2 = end2 ; continue;

or else s01e3 would be categorize before s1e2, which IMO is undesirable (at the expense that leading zeroes would count for nothing, but I think it's a good tradeoff for this specific use case).

I actually had that to start with, and removed it exactly because of the padding / determinism issue. Your argument is a lot more compelling, though. That's something that could actually happen.

I'd use tolower to make it also case insensitive while you're at it, and probably isdigit instead of the digits range checks earlier - the compiler is unlikely IMO to produce slower code than yours.

Use of standard ctype stuff was intentionally removed in 9a210ca2d50e02bf045866bbb2f44a33a3c48cd9, so I don't want to just go and add it back. I'll use the mp_ versions from that commit; ends up being the same code but at least it's clearer.

Seems like at least a few people think this is a good idea, so I'll open a real PR and we can discuss further there.

Please link here so mortals like me can also know/see where the PR goes ;)

6027

A quick workaround with find command to play in natural order:
find "$(pwd)" -type f | sort -V | xargs -n 1 -I {} mpv {}

This is a closed issue because it has been fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thebunnyrules picture thebunnyrules  路  3Comments

paper9oll picture paper9oll  路  3Comments

lightonflux picture lightonflux  路  4Comments

szg0000 picture szg0000  路  3Comments

xanadupark picture xanadupark  路  3Comments