File list sorting

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
GVK
New Cone
New Cone
Posts: 9
Joined: 08 Nov 2010 21:24

File list sorting

Postby GVK » 09 Nov 2010 17:53

I believe, from examining the source code, that VLC effectively creates a playlist from a directory using vlc_scandir in filesystem.c .

So far I have not been able to decipher why this list is not in alphanumeric order.

As a result, users are not able to open a directory and achieve the desired "play in file-name order" performance, which most other media players as well as stand-alone MP3 players do perfectly well.

Remi D-C: please advise.

GVK

Rémi Denis-Courmont
Developer
Developer
Posts: 15326
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: File list sorting

Postby Rémi Denis-Courmont » 09 Nov 2010 18:49

It's not using vlc_scandir(). It just iterates vlc_readdir(), which avoids clogging the I/O bus and the memory while reading a large directory as vlc_scandir() would.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

GVK
New Cone
New Cone
Posts: 9
Joined: 08 Nov 2010 21:24

Re: File list sorting

Postby GVK » 10 Nov 2010 03:25

1. I do not understand the code (sorry for not being an expert in complex code structures):
- Where are the readdir_r and vlc_fix_readdir functions defined ? If they are not, then vlc_readdir does nothing useful (???). I have scanned the entire source code tree and don't see where they are - they ar not in filesystem.c .

2. Anyway, I have now verified the following behavior:
a) On a Mac, if a local directory is dragged to VLC.app on the desktop, the list is played as displayed by file manager or using ls from terminal. However, if a NETWORK-mounted directory is dragged the same way, the order is incorrect.
b) I have not tried VLC in command line with a networked directory on the Mac - my interest is in the Linux case, which is more perverse, as follows.

3. Here is the directory list (using a plain ls command) for a directory - it is the same whether I do ls on a local directory OR on a directory mounted as /media/netmp3/ :

01 - Album de viaje, Op 15, Retrato.mp3
02 - Album de viaje op15 El Casine de Algericas.mp3
03 - Album de viaje, Op 15, Gibraltar.mp3
04 - Album de viaje, Op 15, Paseo nocturno.mp3
05 - Album de viaje, Op 15, Fiesta mora en Tanger.mp3
06 - El Arbol de Guernica op41.mp3
07 - Miniaturas op52 Caminando.mp3
08 - Miniaturas op52 Se acercan soldados.mp3
09 - Miniaturas op52 La aldea duerme.mp3
10 - Miniaturas op52 Amanecer.mp3
11 - Miniaturas op52 El mercado.mp3
12 - Miniaturas op52 Duo sentimental.mp3
13 - Miniaturas op52 Fiesta.mp3
14 - Miniaturas op52 La Vuelta.mp3
15 - El castillo de Almodovar, Op 65, Silueta nocturna.mp3
16 - El Castillo de Almodovar op65 Evocacion medioval.mp3
17 - El castillo de Almodovar, Op 65, A plena luz.mp3
18 - Le cirque op68 Fanfare.mp3
19 - Le cirque op68 Jongleurs.mp3
20 - Le cirque op68 Ecuyere.mp3
21 - Le cirque op68 Le chien savant.mp3
22 - Le cirque op68 Clowns.mp3
23 - Le cirque op68 Trapezes volants.mp3


Here is the intereting thing, however:

I can EITHER use right click "Open With" and VLC, OR use the command line ..../vlc /tmp/'Joaquin Turina - Piano Works' , with the same (improper) results - the first file to play is NOT the file beginning with 01. I have taken a screen shot of the playlist that VLC generates, and plays. (Tell me how to send it to you and I will).

Furthermore, when using command line mode, the following output is generated which may explain the problem:

libdvdnav: Using dvdnav version 4.1.3
libdvdnav: Can't read name block. Probably not a DVD-ROM device.
libdvdnav: Unable to find map file '/home/chrystyna/.dvdnav/.map'
libdvdnav: vm: failed to read VIDEO_TS.IFO

It would appear that VLC insists on playing a DVD structure even on an audio file tree....


Let me know if you would like to get any other material, or for me to invoke logging.

For other lurkers on this board: if you want to avoid this incorrect behavior, use Audacious for audio files, save VLC for video file structures which include proper DVD structures (or directories with single files only).


GVK


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 46 guests