[bug?] MediaPlayer does not respect standards for the *.pls files it generates
Hi everyone! I think I found a little bug in Media Player. It seems to output pls files only for itself, the Qt library does not seem to be able to parse them 'as this'.
Detailed bug
I'm currently developing an app making use of QMediaPlaylist. I want my app to be able to load playlists generated by the media player, in /home/nemo/Music/playlists/. My app load a file from this directory, then my QMediaPlaylist object says it encoutered a parse error... Indeed, in the source code of QMediaPlaylist, we see in the documentation about pls files:
The format is essentially that of an INI file structured as follows:
Header
* [playlist] : This tag indicates that it is a Playlist File
Track Entry
Assuming track entry #X
* FileX : Variable defining location of stream.
* TitleX : Defines track title.
* LengthX : Length in seconds of track. Value of -1 indicates indefinite.
Footer
* NumberOfEntries : This variable indicates the number of tracks.
* Version : Playlist version. Currently only a value of 2 is valid.
[playlist]
File1=Alternative\everclear - SMFTA.mp3
Title1=Everclear - So Much For The Afterglow
Length1=233
File2=http://www.site.com:8000/listen.pls
Title2=My Cool Stream
Length5=-1
NumberOfEntries=2
Version=2*
But, an example of PLS file generated by the media player is:
[playlist]
X-GNOME-Title=David
NumberOfEntries=1
File1=file:///home/nemo/Music/Alanis Morissette - Underneath.mp3
Title1=Underneath
As you see there are some differencies:
- NumberOfEntries is not located in the footer
- X-GNOME-Title : ????
- LengthX field for tracks is never present
- Version=2 is not present at the end of the file
As soon as I modified my example PLS file to get a standards compliant PLS file, the QMediaPlaylist was loaded properly and my app worked.
Conclusion
Several solutions can be presented:
- Either MediaPlayer keeps the .pls extension but then comply to the standards for this file format
- Or MediaPlayer uses another extension than .pls and document its format
- Or MediaPlayer output standard m3u files, or any other well-known file format
So here we are :) Or I did not understand and it is a problem in the Qt library? I'm unsure. I also have to mention that the PLS file format recognized by QMediaPlaylist is the one documented in Wikipedia too. What pushes me to think that the bug is in MediaPlayer outputing strange things :)