FS#12499 - Directory playback fails after saving playlist

Attached to Project: Rockbox
Opened by Boris Gjenero (dreamlayers) - Saturday, 31 December 2011, 05:57 GMT
Last edited by Boris Gjenero (dreamlayers) - Saturday, 31 December 2011, 16:53 GMT
Task Type Bugs
Category Playlists
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


With a real 5G iPod or sim running r31467, directory playback stops working after I save a playlist. To reproduce: play a directory, save the playlist, stop playback, and try to play a directory again. The error is "Playlist Buffer Full".

This happens because the end of playlist_save() sets playlist->buffer = NULL and playlist->buffer_size = 0. The zero buffer_size causes playlist_add() to fail near the start of the function and display that error. When the current playlist file is being overwritten, playlist_save() correctly saves and restores the values, but otherwise, the values aren't saved and they are "restored" from variable initializations at the start.

My patch here solves the problem by unconditionally saving old_buffer and old_buffer_size. (Compared to conditionally restoring the values, it's simpler and it results in smaller binsize.) I removed buffer_handle saving because it's not altered in playlist_save(). The patch also initializes buffer_handle in playlist_init().
This task depends upon

Closed by  Boris Gjenero (dreamlayers)
Saturday, 31 December 2011, 16:53 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in r31481