GNOME Bugzilla – Bug 755069
Playlist sometimes misses out files when 'Include only the selected files' is not selected
Last modified: 2015-11-29 18:37:23 UTC
Debian bug: https://bugs.debian.org/798719 See the above bug. If you generate a playlist with 'Include only the selected files' is not selected then some files don't appear in the final playlist. I bisected the bug to this commit: commit 46109b22591173b722a190a69151e855cea52227 Author: David King <amigadave@amigadave.com> Date: Wed Mar 25 18:44:02 2015 +0100 Simplify core file list management The ETFileList pointer in ET_Core always points to the first item, so avoid calling g_list_first() on it unnecessarily. This probably means that some (other) code is messing up ETCore->ETFileList and this commit happened to workaround it.
This only started happening with update to version 2.4 Generating playlists is unreliable, however it is not random. Removing and regenerating playlist will produce same results.
I have been investigating this on and off, and the bug is caused by the sorting code in EasyTAG confusing two linked lists. While the comments make it clear that the ETFileList pointer in ET_Core will always point to the head of the list, and the ETFileDisplayedList pointer is permitted to point to any node of the list, both lists are just pointers into the same list. The means that sorting the ETFileDisplayedList leads to the head of the ETFileList changing as well (if the sort results in that happening, of course). There either needs to be some synchronisation of the two lists, or the ETFileDisplayedList should be a completely separate list. A revert might be the easy way out, but the underlying confusion is probably the cause of a few more bugs (memory leaks, at the very least), so I would rather fix this properly.
Created attachment 315430 [details] [review] synchronize the file list pointer This patch seems to work for me. It is a bit difficult to tell whether this has caught all the cases where the list pointers can get out of sync, so it needs a bit more testing.
Review of attachment 315430 [details] [review]: I pushed this to master as commit 9adaa19236a14206c05c24b957c765833a79d834.