diff options
author | wm4 <wm4@nowhere> | 2020-01-04 20:00:43 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-01-04 20:00:43 +0100 |
commit | 119bad4daaf206300bb4b55c269ff407e9537bf4 (patch) | |
tree | 0f6a652fc07ae8536333711d1da0b293bec62aab /stream/stream_libarchive.c | |
parent | 1b283f6b60cce278aeb0c4fb675faac493546ab6 (diff) | |
download | mpv-119bad4daaf206300bb4b55c269ff407e9537bf4.tar.bz2 mpv-119bad4daaf206300bb4b55c269ff407e9537bf4.tar.xz |
stream_libarchive: add annoying message regarding multi-volume archives
I'm done.
Diffstat (limited to 'stream/stream_libarchive.c')
-rw-r--r-- | stream/stream_libarchive.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/stream/stream_libarchive.c b/stream/stream_libarchive.c index a43f2e633f..e068a9ca0c 100644 --- a/stream/stream_libarchive.c +++ b/stream/stream_libarchive.c @@ -218,7 +218,7 @@ static const struct file_pattern patterns[] = { { NULL, NULL, NULL, 0, 0 }, }; -static bool find_volumes(struct mp_archive *mpa) +static bool find_volumes(struct mp_archive *mpa, bool *is_multivolume) { struct bstr primary_url = bstr0(mpa->primary_src->url); @@ -239,6 +239,7 @@ static bool find_volumes(struct mp_archive *mpa) if (!add_volume(mpa, NULL, url, i + 1)) return false; } + *is_multivolume = true; return true; } @@ -264,9 +265,10 @@ struct mp_archive *mp_archive_new(struct mp_log *log, struct stream *src, if (!add_volume(mpa, src, src->url, 0)) goto err; + bool is_multivolume = false; if (!(flags & MP_ARCHIVE_FLAG_NO_RAR_VOLUMES)) { // try to open other volumes - if (!find_volumes(mpa)) + if (!find_volumes(mpa, &is_multivolume)) goto err; } @@ -298,6 +300,15 @@ struct mp_archive *mp_archive_new(struct mp_log *log, struct stream *src, if (fail) goto err; + + if (is_multivolume) { + MP_WARN(mpa, "This appears to be a multi-volume rar file. Support is " + "not very good due to lack of good libarchive support for them. " + "They are also an excessively inefficient and stupid way to " + "distribute media files, so tell the people creating these files " + "to fuck off.\n"); + } + return mpa; err: |