Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support relative paths when loading DBPL playlists #3115

Closed
wants to merge 6 commits into from

Conversation

rsekman
Copy link
Contributor

@rsekman rsekman commented Aug 24, 2024

related to: #1798

when loading an M3U playlist deadbeef supports interpreting the paths relative to the location of the playlist file. this feature is currently missing from the code loading native (DBPL) playlists, but is implemented in this pull request.

this PR will not pass CI due to a segmentation fault in the Playlist test suite. the segmentation fault occurs only if the Playlist test suite is not run first. that is,

./scripts/test.sh Playlist AlbumNavigation #passes
./scripts/test.sh AlbumNavigation Playlist #segfaults

the segfault occurs here, when checking if loading the playlist should be handled by a plugin:

deadbeef/src/playlist.c

Lines 2707 to 2711 in a50e3a5

DB_playlist_t **plug = plug_get_playlist_list ();
int p, e;
for (p = 0; plug[p]; p++) {
for (e = 0; plug[p]->extensions[e]; e++) {
if (plug[p]->load && !strcasecmp (ext, plug[p]->extensions[e])) {

if the Playlist test suite is run first, the array plug is empty (plug[0] == NULL), but if not it contains an invalid pointer. I do not understand why this happens and don't know how to trace it further.

src/playlist.c Outdated Show resolved Hide resolved
src/playlist.c Outdated Show resolved Hide resolved
src/playlist.c Show resolved Hide resolved
@Oleksiy-Yakovenko
Copy link
Member

this PR will not pass CI due to a segmentation fault in the Playlist test suite. the segmentation fault occurs only if the Playlist test suite is not run first. that is,

This seems like some sort of test setup problem. I'm sure I'll be able to figure it out, but I'm a bit time constrained in the next few weeks.
I'll try to debug it as soon as I can.

- dynamically allocate memory instead of big stacks
- treat legacy and metadata URI values equally
now we just need one alloc/free per playlist as opposed to one alloc/free per item
src/playlist.c Outdated Show resolved Hide resolved
memory for the directory name and the true uri should be allocated at the very top of the function so that it can be unconditionally free()'d at the end.
also, no need to check for NULL when calling free().
@Oleksiy-Yakovenko
Copy link
Member

I fixed the issue with tests and merged everything to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants