stream_bluray: support detecting UHD BD directories

Close #5325
This commit is contained in:
Ricardo Constantino 2018-01-11 01:02:16 +00:00
parent 154ff98128
commit e3bee23fe4
No known key found for this signature in database
GPG Key ID: EFD16019AE4FF531
1 changed files with 8 additions and 11 deletions

View File

@ -529,19 +529,16 @@ static bool check_bdmv(const char *path)
if (!temp)
return false;
bool r = false;
const char *sig1 = "MOBJ020";
const char *sig2 = "MOBJ0100";
char data[50];
if (fread(data, 50, 1, temp) == 1) {
r = memcmp(data, sig1, strlen(sig1)) == 0 ||
memcmp(data, sig2, strlen(sig2)) == 0;
}
char data[50] = {0};
fread(data, 50, 1, temp);
fclose(temp);
return r;
bstr bdata = {data, 50};
return bstr_startswith0(bdata, "MOBJ0100") || // AVCHD
bstr_startswith0(bdata, "MOBJ0200") || // Blu-ray
bstr_startswith0(bdata, "MOBJ0300"); // UHD BD
}
// Destructively remove the current trailing path component.