Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
stream_bluray: support detecting UHD BD directories
Close #5325
  • Loading branch information
wiiaboo committed Jan 11, 2018
1 parent 154ff98 commit e3bee23
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions stream/stream_bluray.c
Expand Up @@ -529,19 +529,16 @@ static bool check_bdmv(const char *path)
if (!temp)
return false;

bool r = false;
char data[50] = {0};

const char *sig1 = "MOBJ020";
const char *sig2 = "MOBJ0100";
char data[50];
fread(data, 50, 1, temp);
fclose(temp);

if (fread(data, 50, 1, temp) == 1) {
r = memcmp(data, sig1, strlen(sig1)) == 0 ||
memcmp(data, sig2, strlen(sig2)) == 0;
}
bstr bdata = {data, 50};

fclose(temp);
return r;
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.
Expand Down

1 comment on commit e3bee23

@kkkrackpot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working now, thanks!

Please sign in to comment.