After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 551610 - M3U playlists are no longer saved in a format that can be opened
M3U playlists are no longer saved in a format that can be opened
Status: RESOLVED FIXED
Product: totem-pl-parser
Classification: Core
Component: General
2.23.x
Other All
: Normal normal
: ---
Assigned To: totem-pl-parser-maint
totem-pl-parser-maint
Depends on:
Blocks:
 
 
Reported: 2008-09-10 06:57 UTC by D. Grady
Modified: 2008-09-10 18:19 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
A unified diff with a proposed patch that will make the write forward-compliant (698 bytes, patch)
2008-09-10 06:59 UTC, D. Grady
none Details | Review

Description D. Grady 2008-09-10 06:57:27 UTC
Please describe the problem:
Older versions of totem-pl-parser would parse correctly a M3U playlist when it did not have a #EXTM3U header as the first line.  The newest version of totem-pl-parser REQUIRES this header, and fails to load the playlist without it.  However, the function to write the playlist doesn't yet add this header, so even a new playlist written with totem-pl-parser will become impossible to use with totem-pl-parser.

Steps to reproduce:
1. Create a playlist, save as .m3u
2. Try to open the playlist.
3. 


Actual results:
"Cannot determine stream type"

Expected results:
Opens playlist and starts playing songs listed.

Does this happen every time?
yes

Other information:
the problem is in totem-pl-parser-lines.c  (for write, not sure how to give it a backwards compatible read yet.)
Comment 1 D. Grady 2008-09-10 06:59:51 UTC
Created attachment 118411 [details] [review]
A unified diff with a proposed patch that will make the write forward-compliant

If other forms of this are preferable I'm happy to provide them, this is my first attempt to submit a patch.
Comment 2 Bastien Nocera 2008-09-10 10:21:58 UTC
About your patch:
- You were ignoring which carriage return to use (either \n or \r\n for DOS-compatible)
- totem_pl_parser_write_* functions already unref the stream on error, so no need to close the stream

Thanks!

2008-09-10  Bastien Nocera  <hadess@hadess.net>

	* plparse/totem-pl-parser-lines.c (totem_pl_parser_write_m3u):
	* plparse/totem-pl-parser-pla.c (totem_pl_parser_write_pla):
	* plparse/totem-pl-parser-pls.c (totem_pl_parser_write_pls):
	* plparse/totem-pl-parser-xspf.c (totem_pl_parser_write_xspf):
	Always write the #EXTM3U line at the start of M3U playlists,
	Spotted by D. Grady <fehknt@gmail.com> (Closes: #551610)
	Don't unref streams that totem_pl_parser_write_* will unref
	on error, and make sure the streams are unref'ed and not just closed
Comment 3 D. Grady 2008-09-10 18:19:47 UTC
OK - I assume that by marking it "resolved" that you've taken care of these issues with my patch?

Also - there remains the problem of backward compatibility.  I don't know how it was done before - lacking a header, on error, maybe try parsing based on file extension?  Is this something that someone can fix easily or should I try to fix this too?