Skip to content

VLC encounters issues with playlists using open square bracket '['

Description

I attempted to create a playlist of a new album I'd purchased; when I drag-and-dropped the songs into the VLC playlist window they were read and played fine so I saved the playlist. However, when I later attempted to open the playlist, it failed to open. After trial and error I determined that the offending character was an open square bracket: [.

The error behaves similarly whether the song's path or filename itself contains the square bracket (a bracket in the path causes the entire list to not load, brackets in the filenames cause those files to not load); brackets in metadata did not cause this problem (when I removed the brackets from the path and filenames, playlist creation and loading worked fine even with brackets remaining in the metadata song title).

If the playlist filename itself contains an open square bracket, an entirely new set of errors seems to occur; the VLC playlist populates with the song metadata but the files cannot be opened.

This issue should be prioritized at least to some degree, as many song titles and/or album titles (and thus path and filenames) may include the [Explicit] tag; while a workaround is to rename the paths/files to replace or remove the bracket, this is tedious at a minimum, and possibly undesirable by users.

  • Platform: Windows 10 Pro 21H2 build 19044.1466
  • Software: VLC 3.0.16 Vetinari (originally discovered on 3.0.8)

Steps to test/reproduce:

"Control" test (t1)

  1. Take a folder with music files (tested with ogg and mp3) that DO NOT contain [
  2. Select all files within the folder, add to VLC playlist, save playlist as M3U8 (with no [ characters in playlist filename) in same path as the folder itself (i.e. one level above the songs)
  3. Clear the VLC playlist
  4. Open the M3U8 playlist in VLC
  5. Playlist opens and plays as expected

Bad path test (t2)

  1. Taking the same folder/files as in control test, rename the folder to contain the [ character
  2. Select all files within the folder, add to VLC playlist, save playlist as M3U8 in same path as the folder itself
  3. Clear the VLC playlist
  4. Open the M3U8 playlist in VLC
  5. Playlist empties upon attempting to play

Bad filename test (t3)

  1. Taking the same folder/files as in control test, rename one or more song files to contain the [ character
  2. Select all files within the folder, add to VLC playlist, save playlist as M3U8 in same path as the folder itself
  3. Clear the VLC playlist
  4. Open the M3U8 playlist in VLC
  5. Any songs whose filenames contain [ are not loaded into the playlist

Bad playlist name test (t4)

  1. Taking the same folder/files as in control test, select all files within the folder, add to VLC playlist, save playlist as M3U8 with the [ character in the playlist filename
  2. Clear the VLC playlist
  3. Open the M3U8 playlist in VLC
  4. Errors will be reported attempting to open the songs; path data appears to get lost

Attachments

Playlist files corresponding to the above tests:

Logs corresponding to the above tests:

Notes

  • User-level paths in the logs have been sanitized, replacing my account name with username.
  • Some paths and files have been reused (e.g. test 3, test 1); where filenames differ, the files were renamed correspondingly according to the test. Each playlist was freshly generated using path data that was accurate for the duration of that test.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information