feat: use loadlist when opening playlists #929
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opening a playlist with loadfile can lead to problems like autoload.lua populating the playlist with other files that were in the same directory as the playlist file.
To avoid that the command loadlist can be used to avoid having mpv treat the file like any other, just to notice during demuxing that it is a playlist.
ref. #927 (comment)
@hooke007 You won't like that this is based on the file extension, but I don't know how else we would go about doing it. We could read the beginning of the file and deciding based on that, but I'd rather not do that unless it's very important to do that. I've checked if we could do something via mime-type (e.g.
file --mime-type
on linux), but m3u8 playlists simply show up as plain text, so we'd have to treat all text files as playlists.