mirror of
https://github.com/mpv-player/mpv
synced 2025-03-22 03:08:33 +00:00
demux_mkv: support WebM files
Accept files with doctype "webm" in addition to "matroska".
This commit is contained in:
parent
407b17614a
commit
9a2224ac0f
@ -31,6 +31,7 @@
|
||||
|
||||
#include "talloc.h"
|
||||
#include "options.h"
|
||||
#include "bstr.h"
|
||||
#include "stream/stream.h"
|
||||
#include "demuxer.h"
|
||||
#include "stheader.h"
|
||||
@ -1642,8 +1643,8 @@ static int demux_mkv_open(demuxer_t *demuxer)
|
||||
struct ebml_parse_ctx parse_ctx = { .no_error_messages = true };
|
||||
if (ebml_read_element(s, &parse_ctx, &ebml_master, &ebml_ebml_desc) < 0)
|
||||
return 0;
|
||||
if (ebml_master.doc_type.len != 8 || strncmp(ebml_master.doc_type.start,
|
||||
"matroska", 8)) {
|
||||
if (bstrcmp(ebml_master.doc_type, BSTR("matroska")) != 0
|
||||
&& bstrcmp(ebml_master.doc_type, BSTR("webm")) != 0) {
|
||||
mp_msg(MSGT_DEMUX, MSGL_DBG2, "[mkv] no head found\n");
|
||||
talloc_free(parse_ctx.talloc_ctx);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user