We have moved to a new Sailfish OS Forum. Please start new discussions there.
1 | initial version | posted 2014-05-25 01:01:12 +0200 |
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'.
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:
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.
Several solutions can be presented:
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 :)
2 | retagged |
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'.
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:
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.
Several solutions can be presented:
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 :)