From 1b283f6b60cce278aeb0c4fb675faac493546ab6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 4 Jan 2020 19:53:57 +0100 Subject: libarchive: some shitty hack to make opening slightly faster See manpage additions. The libarchive behavior mentioned in the last paragraph there is technically unrelated, but makes this new option mostly pointless. See: #7182 --- stream/stream_libarchive.c | 8 +++++--- stream/stream_libarchive.h | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'stream') diff --git a/stream/stream_libarchive.c b/stream/stream_libarchive.c index 7c48f3a135..a43f2e633f 100644 --- a/stream/stream_libarchive.c +++ b/stream/stream_libarchive.c @@ -264,9 +264,11 @@ struct mp_archive *mp_archive_new(struct mp_log *log, struct stream *src, if (!add_volume(mpa, src, src->url, 0)) goto err; - // try to open other volumes - if (!find_volumes(mpa)) - goto err; + if (!(flags & MP_ARCHIVE_FLAG_NO_RAR_VOLUMES)) { + // try to open other volumes + if (!find_volumes(mpa)) + goto err; + } locale_t oldlocale = uselocale(mpa->locale); diff --git a/stream/stream_libarchive.h b/stream/stream_libarchive.h index bb5dee432b..f9e05fcbee 100644 --- a/stream/stream_libarchive.h +++ b/stream/stream_libarchive.h @@ -24,7 +24,8 @@ struct mp_archive { void mp_archive_free(struct mp_archive *mpa); -#define MP_ARCHIVE_FLAG_UNSAFE 1 +#define MP_ARCHIVE_FLAG_UNSAFE (1 << 0) +#define MP_ARCHIVE_FLAG_NO_RAR_VOLUMES (1 << 1) struct mp_archive *mp_archive_new(struct mp_log *log, struct stream *src, int flags, int max_volumes); -- cgit v1.2.3