mirror of https://github.com/mpv-player/mpv
Revert "stream_libarchive: remove "old" rar volume pattern"
This reverts commit 1b0129c414
.
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.
This commit is contained in:
parent
e666546910
commit
3ef0754102
|
@ -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 },
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue