diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-05-30 17:15:22 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-05-30 17:15:22 +0300 |
commit | 9a2224ac0f8aa2a2aabb18760f6c25d157c463f1 (patch) | |
tree | 38f71ef3137b40f10613755ed69a9f377a30f0d6 /libmpdemux | |
parent | 407b17614af49985fed13fa9c69a8e47e22766fe (diff) | |
download | mpv-9a2224ac0f8aa2a2aabb18760f6c25d157c463f1.tar.bz2 mpv-9a2224ac0f8aa2a2aabb18760f6c25d157c463f1.tar.xz |
demux_mkv: support WebM files
Accept files with doctype "webm" in addition to "matroska".
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_mkv.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index eedde00fd6..a002e5665d 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -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; |