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

demux_playlist: consider input file ext for autocreate-playlist=filter #15017

Conversation

christoph-heinrich
Copy link
Contributor

Opening a media file with an extension that's not part of any extension list doesn't open that file and instead creates a playlist and then plays the first file.

Instead only create the playlist if the file extension fits into the playlist, like is already the case with autocreate-playlist=same.

Opening a media file with an extension that's not part of any extension
list doesn't open that file and instead creates a playlist and then plays
the first file.

Instead only create the playlist if the file extension fits into the
playlist, like is already the case with autocreate-playlist=same.
@kasper93
Copy link
Contributor

kasper93 commented Oct 8, 2024

I would keep current autocreate-playlist=filter behavior. Just with bugfix to add the file that is currently being opened as an exception.

diff --git a/demux/demux_playlist.c b/demux/demux_playlist.c
index 46bac914cb..75e49fc0a9 100644
--- a/demux/demux_playlist.c
+++ b/demux/demux_playlist.c
@@ -416,6 +416,9 @@ static bool test_path(struct pl_parser *p, char *path, int autocreate)
     if (autocreate & AUTO_ANY)
         return true;

+    if (!strcmp(path, p->real_stream->path))
+        return true;
+
     bstr ext = bstr_get_ext(bstr0(path));
     if (autocreate & AUTO_VIDEO && str_in_list(ext, p->mp_opts->video_exts))
         return true;

@christoph-heinrich
Copy link
Contributor Author

I would keep current autocreate-playlist=filter behavior. Just with bugfix to add the file that is currently being opened as an exception.

I'm fine with that too, will you make a PR for that?

Copy link

github-actions bot commented Oct 8, 2024

Download the artifacts for this pull request:

Windows
macOS

@kasper93
Copy link
Contributor

kasper93 commented Oct 8, 2024

I would keep current autocreate-playlist=filter behavior. Just with bugfix to add the file that is currently being opened as an exception.

I'm fine with that too, will you make a PR for that?

@christoph-heinrich: #15027 is it ok for you?

@christoph-heinrich
Copy link
Contributor Author

I would keep current autocreate-playlist=filter behavior. Just with bugfix to add the file that is currently being opened as an exception.

I'm fine with that too, will you make a PR for that?

@christoph-heinrich: #15027 is it ok for you?

Yes, thanks.

@christoph-heinrich christoph-heinrich deleted the create_playlist_if_match branch October 8, 2024 17:55
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