diff options
author | wm4 <wm4@nowhere> | 2020-01-20 18:15:52 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-01-20 19:58:51 +0100 |
commit | 3ef0754102541f731916060f81a8653e387ee2a6 (patch) | |
tree | 93eac42dc79c6c05a8a2a533d4c69ae70ced9e53 | |
parent | e6665469105e703484feddef77a48b8f0beed887 (diff) | |
download | mpv-3ef0754102541f731916060f81a8653e387ee2a6.tar.bz2 mpv-3ef0754102541f731916060f81a8653e387ee2a6.tar.xz |
Revert "stream_libarchive: remove "old" rar volume pattern"
This reverts commit 1b0129c4143fe73ef0ee3c3f1e2bed734c374d40.
It turns out most of the files affected by the idiotic use-case actually
use this old naming pattern, which I hoped was unused.
This means for now we'll always assume .rar files are multi-part (until
proven otherwise), but the following commit tries to fix this.
-rw-r--r-- | stream/stream_libarchive.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/stream/stream_libarchive.c b/stream/stream_libarchive.c index eca5c73153..795ac45030 100644 --- a/stream/stream_libarchive.c +++ b/stream/stream_libarchive.c @@ -220,6 +220,13 @@ static char *standard_volume_url(void *ctx, const char *format, return talloc_asprintf(ctx, format, BSTR_P(base), index); } +static char *old_rar_volume_url(void *ctx, const char *format, + struct bstr base, int index) +{ + return talloc_asprintf(ctx, format, BSTR_P(base), + 'r' + index / 100, index % 100); +} + struct file_pattern { const char *match; const char *format; @@ -234,6 +241,7 @@ static const struct file_pattern patterns[] = { { ".part01.rar", "%.*s.part%.2d.rar", standard_volume_url, 2, 99 }, { ".part001.rar", "%.*s.part%.3d.rar", standard_volume_url, 2, 999 }, { ".part0001.rar", "%.*s.part%.4d.rar", standard_volume_url, 2, 9999 }, + { ".rar", "%.*s.%c%.2d", old_rar_volume_url, 0, 9999 }, { ".001", "%.*s.%.3d", standard_volume_url, 2, 9999 }, { NULL, NULL, NULL, 0, 0 }, }; |