-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
command: add playlist-next-playlist and playlist-prev-playlist #12526
command: add playlist-next-playlist and playlist-prev-playlist #12526
Conversation
Download the artifacts for this pull request: |
0f8fb31
to
cc57ca2
Compare
playlist-prev-playlist goes to the beginning of the previous playlist because this seems more useful and symmetrical to playlist-next-playlist. It does not go to the beginning when the current playlist-path starts with the previous playlist-path, e.g. with mpv --loop-playlist foo/, which expands to foo/{1..9}.zip, the current playlist path foo/1.zip beings with the playlist-path foo/ of {2..9}.zip and thus playlist-prev-playlist goes to 9.zip rather than to 2.zip. Closes mpv-player#12495.
cc57ca2
to
3cdf9a3
Compare
Rebased. |
mpv crashed after call Reproduction steps
|
This was fixed months ago. |
Still able to reproduce the issue using https://github.com/zhongfly/mpv-winbuild/releases/tag/2024-02-18-3fd840f with |
I can't reproduce that. |
Looks like it's crashing here: Lines 262 to 269 in 4a563a6
I don't know how to fix it properly, but this patch works: diff --git a/common/playlist.c b/common/playlist.c
index 5de8e627..e223a292 100644
--- a/common/playlist.c
+++ b/common/playlist.c
@@ -259,14 +259,14 @@ struct playlist_entry *playlist_get_first_in_same_playlist(
// work in all cases.
char* playlist_path = talloc_strdup(tmp, entry->playlist_path);
mp_path_strip_trailing_separator(playlist_path);
- if (bstr_startswith(bstr0(current_playlist_path),
+ if (!mp_is_url(bstr0(current_playlist_path)) && (bstr_startswith(bstr0(current_playlist_path),
bstr0(talloc_strdup_append(playlist_path, "/")))
#if HAVE_DOS_PATHS
||
bstr_startswith(bstr0(current_playlist_path),
bstr0(talloc_strdup_append(playlist_path, "\\")))
#endif
- )
+ ))
goto exit;
struct playlist_entry *prev = playlist_entry_get_rel(entry, -1);
|
It still doesn't crash for me and I don't understand why you should skip that check with URLs. |
I also cannot reproduce. Dunno, check if there's something weird in your config causing this although I don't know what that would be. |
playlist-prev-playlist goes to the beginning of the previous playlist because this seems more useful and symmetrical to playlist-next-playlist. It does not go to the beginning when the current playlist-path starts with the previous playlist-path, e.g. with mpv --loop-playlist foo/, which expands to foo/{1..9}.zip, the current playlist path foo/1.zip beings with the playlist-path foo/ of {2..9}.zip and thus playlist-prev-playlist goes to 9.zip rather than to 2.zip.
Closes #12495.