Skip to content

High CPU usage when looping over single invalid media file

steps to reproduce:

  • create a file with a .mp3 or .mp4 extension
  • open in text editor and set value to "this is not an mp4" or similar
  • start VLC and add this file to the playlist
  • set loop mode to "loop all" or "loop one"
  • press play
  • FOR LINUX USERS IF DESKTOP ENVIRONMENT FREEZES:
    • CTRL-ALT-F1 into a terminal, login, and killall vlc

result:

  • VLC increases CPU usage significantly (didn't test on high core count systems for limit)
  • WINDOWS:
    • VLC becomes unresponsive
    • notification spam after killing VLC (takes a while to clear all notifications)
  • LINUX(Ubuntu 20.04LTS / XFCE):
    • desktop environment freezes

system info:

  • Windows:
    • Windows 10 home 20H2(Build:19042.1586)
    • VLC 10.0.16 (latest as of filing)
      • older version tested(10.0.10) with similar results
  • Linux:
    • 5.4.0-89-generic #100-Ubuntu SMP x86_64 x86_64 x86_64 x86_64 GNU/Linux
    • Ubuntu 20.04.4 LTS
    • VLC 3.0.9.2
      • not the latest version, but I don't think this has changed

reason this is very annoying:

  • VLC sets itself as the handler for lots of file extensions
    • extensions also used by other programs for non-media files
  • VLC remembers loop setting
  • if you usually loop a playlist double clicking a file can freeze the system(Linux)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information