summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2020-04-27 00:25:58 -0700
committerKevin Mitchell <kevmitch@gmail.com>2020-04-27 21:11:31 -0700
commit9285a1c05e2c5f55caa5cbaa24a504bb24e7dbc4 (patch)
tree0eeda8b21ce5a7f2fbe4aa6a39ce81c06ec255c1
parent430b6f9f1215f1fa33500003d200a83de29e56d3 (diff)
downloadmpv-9285a1c05e2c5f55caa5cbaa24a504bb24e7dbc4.tar.bz2
mpv-9285a1c05e2c5f55caa5cbaa24a504bb24e7dbc4.tar.xz
stream_libarchive: simplify multi-volume rar hate message
I couldn't find any reason for this message to be so far dispalced from where it's necessity was determined. That necessity is not however in question. Also improve the wording and line breaking.
-rw-r--r--stream/stream_libarchive.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/stream/stream_libarchive.c b/stream/stream_libarchive.c
index 0b48233f8c..ca6f9db032 100644
--- a/stream/stream_libarchive.c
+++ b/stream/stream_libarchive.c
@@ -260,8 +260,7 @@ static const struct file_pattern patterns[] = {
{ NULL, NULL, NULL, 0, 0 },
};
-static bool find_volumes(struct mp_archive *mpa, bool multivol_hint,
- bool *is_multivolume)
+static bool find_volumes(struct mp_archive *mpa, bool multivol_hint)
{
struct bstr primary_url = bstr0(mpa->primary_src->url);
@@ -284,7 +283,12 @@ static bool find_volumes(struct mp_archive *mpa, bool multivol_hint,
if (!add_volume(mpa, NULL, url, i + 1))
return false;
}
- *is_multivolume = true;
+
+ MP_WARN(mpa, "This appears to be a multi-volume archive.\n"
+ "Support is not very good due to libarchive limitations.\n"
+ "There are known cases of libarchive crashing mpv on these.\n"
+ "This is also an excessively inefficient and stupid way to distribute\n"
+ "media files. People creating them should rethink this.\n");
return true;
}
@@ -315,10 +319,9 @@ struct mp_archive *mp_archive_new(struct mp_log *log, struct stream *src,
bool probe_all = flags & MP_ARCHIVE_FLAG_UNSAFE;
bool maybe_rar2_multivol = maybe_rar && probe_multi_rar(src);
- bool is_multivolume = false;
if (!(flags & MP_ARCHIVE_FLAG_NO_RAR_VOLUMES)) {
// try to open other volumes
- if (!find_volumes(mpa, maybe_rar2_multivol, &is_multivolume))
+ if (!find_volumes(mpa, maybe_rar2_multivol))
goto err;
}
@@ -360,15 +363,6 @@ 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 rethink this.\n");
- MP_WARN(mpa, "There are known cases of libarchive crashing mpv on these.\n");
- }
-
return mpa;
err: