summaryrefslogtreecommitdiffstats
path: root/stream/stream_bluray.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/stream_bluray.c')
-rw-r--r--stream/stream_bluray.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c
index 25dd1d4f8f..4dad779739 100644
--- a/stream/stream_bluray.c
+++ b/stream/stream_bluray.c
@@ -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.