We have moved to a new Sailfish OS Forum. Please start new discussions there.
6

[bug?] MediaPlayer does not respect standards for the *.pls files it generates

asked 2014-05-25 01:01:12 +0300

DaTa gravatar image

updated 2014-07-24 10:10:59 +0300

jiit gravatar image

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:

  1. NumberOfEntries is not located in the footer
  2. X-GNOME-Title : ????
  3. LengthX field for tracks is never present
  4. 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:

  1. Either MediaPlayer keeps the .pls extension but then comply to the standards for this file format
  2. Or MediaPlayer uses another extension than .pls and document its format
  3. 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 :)

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
0

answered 2014-06-16 15:48:09 +0300

Tanty gravatar image

The PLS format is a poorly documented one.

An example of its management can be checked in VLC:

As you can see, very few fields are mandatory for VLC and other fields should be allowed and ignored.

In Mediaplayer, Totem PlaylistParser is used:

My suggestion is to open a bug to QtMultimedia about QMediaPlaylist.

You have the option of opening the bug to Totem PlaylistParser but I think QtMultimedia should be more flexible when parsing PLS files because, probably, Totem PlaylistParser would not be the only one providing non according playlists for it.

edit flag offensive delete publish link more

Comments

Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2014-05-25 01:01:12 +0300

Seen: 736 times

Last updated: Jun 16 '14