summaryrefslogtreecommitdiffstats
path: root/stream/stream_libarchive.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-01-04 18:59:23 +0100
committerwm4 <wm4@nowhere>2020-01-04 18:59:23 +0100
commit04bde06095215f27cef0be01ce4d831ab2719591 (patch)
tree67c353219977f03182015a9427a0f2a4a300892b /stream/stream_libarchive.h
parent657ce1b15c2e6dca0ed1ea1b67ffa123843eca5b (diff)
downloadmpv-04bde06095215f27cef0be01ce4d831ab2719591.tar.bz2
mpv-04bde06095215f27cef0be01ce4d831ab2719591.tar.xz
stream_libarchive: some more hacks to improve multi-volume archives
Instead of opening every volume on start just to see if it's there, all all volumes that could possibly exist, and "handle" it on opening. This requires working around some of libarchive's amazing stupidity and using some empirically determined behavior. Will possibly break if libarchive changes some of this behavior. See: #7182
Diffstat (limited to 'stream/stream_libarchive.h')
-rw-r--r--stream/stream_libarchive.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/stream/stream_libarchive.h b/stream/stream_libarchive.h
index 8884834189..bb5dee432b 100644
--- a/stream/stream_libarchive.h
+++ b/stream/stream_libarchive.h
@@ -14,6 +14,7 @@ struct mp_archive {
struct archive *arch;
struct stream *primary_src;
char buffer[4096];
+ int num_volumes; // INT_MAX if unknown (initial state)
// Current entry, as set by mp_archive_next_entry().
struct archive_entry *entry;
@@ -25,6 +26,6 @@ void mp_archive_free(struct mp_archive *mpa);
#define MP_ARCHIVE_FLAG_UNSAFE 1
struct mp_archive *mp_archive_new(struct mp_log *log, struct stream *src,
- int flags);
+ int flags, int max_volumes);
bool mp_archive_next_entry(struct mp_archive *mpa);