mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +00:00
libarchive: prefix entry names in archive URLs with '/'
This has the advantage that playlists within the archive will work as expected, because demux_playlist will correctly join the archive base URL and entry name. Before this change, it could skip before the "|", resulting in a broken URL.
This commit is contained in:
parent
505cab9c15
commit
572c32abbe
@ -74,7 +74,7 @@ static int open_file(struct demuxer *demuxer, enum demux_check check)
|
|||||||
|
|
||||||
while (mp_archive_next_entry(mpa)) {
|
while (mp_archive_next_entry(mpa)) {
|
||||||
// stream_libarchive.c does the real work
|
// stream_libarchive.c does the real work
|
||||||
char *f = talloc_asprintf(mpa, "archive://%s|%s", prefix,
|
char *f = talloc_asprintf(mpa, "archive://%s|/%s", prefix,
|
||||||
mpa->entry_filename);
|
mpa->entry_filename);
|
||||||
MP_TARRAY_APPEND(mpa, files, num_files, f);
|
MP_TARRAY_APPEND(mpa, files, num_files, f);
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,9 @@ static int archive_entry_open(stream_t *stream)
|
|||||||
char *base = talloc_strdup(p, stream->path);
|
char *base = talloc_strdup(p, stream->path);
|
||||||
char *name = strchr(base, '|');
|
char *name = strchr(base, '|');
|
||||||
*name++ = '\0';
|
*name++ = '\0';
|
||||||
p->entry_name = name;
|
if (name[0] != '/')
|
||||||
|
return STREAM_ERROR;
|
||||||
|
p->entry_name = name + 1;
|
||||||
mp_url_unescape_inplace(base);
|
mp_url_unescape_inplace(base);
|
||||||
|
|
||||||
p->src = stream_create(base, STREAM_READ | STREAM_SAFE_ONLY,
|
p->src = stream_create(base, STREAM_READ | STREAM_SAFE_ONLY,
|
||||||
|
Loading…
Reference in New Issue
Block a user