diff --git a/content/media/test/Makefile.in b/content/media/test/Makefile.in index fc732b6a1a8..62b089febce 100644 --- a/content/media/test/Makefile.in +++ b/content/media/test/Makefile.in @@ -192,6 +192,7 @@ _TEST_FILES += \ bug523816.ogv \ bug533822.ogg \ bug557094.ogv \ + bug580982.webm \ chain.ogv \ dirac.ogg \ seek.ogv \ diff --git a/content/media/test/bug580982.webm b/content/media/test/bug580982.webm new file mode 100644 index 00000000000..802019f39f6 Binary files /dev/null and b/content/media/test/bug580982.webm differ diff --git a/content/media/test/manifest.js b/content/media/test/manifest.js index 679e2367bad..5a04337a8fb 100644 --- a/content/media/test/manifest.js +++ b/content/media/test/manifest.js @@ -190,6 +190,7 @@ var gErrorTests = [ { name:"448636.ogv", type:"video/ogg" }, { name:"bug504843.ogv", type:"video/ogg" }, { name:"bug501279.ogg", type:"audio/ogg" }, + { name:"bug580982.webm", type:"video/webm" }, { name:"bogus.duh", type:"bogus/duh" } ]; diff --git a/media/libnestegg/README_MOZILLA b/media/libnestegg/README_MOZILLA index 6cc5331ce30..be53f8d8b0f 100644 --- a/media/libnestegg/README_MOZILLA +++ b/media/libnestegg/README_MOZILLA @@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system. The nestegg git repository is: git://github.com/kinetiknz/nestegg.git -The git commit ID used was 5f0ffb8d31782db47d3db541f038caae4ddee9e6. +The git commit ID used was 844b8bc7695e2d60ad7bde3fb5105c0b24304640. diff --git a/media/libnestegg/include/Makefile.in b/media/libnestegg/include/Makefile.in index 6e78d408256..9f0f73af797 100644 --- a/media/libnestegg/include/Makefile.in +++ b/media/libnestegg/include/Makefile.in @@ -43,6 +43,6 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk EXPORTS_NAMESPACES = nestegg -EXPORTS_nestegg = nestegg.h _stdint.h +EXPORTS_nestegg = nestegg.h nestegg-stdint.h include $(topsrcdir)/config/rules.mk diff --git a/media/libnestegg/include/_stdint.h b/media/libnestegg/include/nestegg-stdint.h similarity index 100% rename from media/libnestegg/include/_stdint.h rename to media/libnestegg/include/nestegg-stdint.h diff --git a/media/libnestegg/include/nestegg.h b/media/libnestegg/include/nestegg.h index ade087b9530..cad37562b94 100644 --- a/media/libnestegg/include/nestegg.h +++ b/media/libnestegg/include/nestegg.h @@ -7,7 +7,7 @@ #ifndef NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79 #define NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79 -#include "_stdint.h" +#include #ifdef __cplusplus extern "C" { diff --git a/media/libnestegg/src/nestegg.c b/media/libnestegg/src/nestegg.c index ca70ca57c7a..d7093df2318 100644 --- a/media/libnestegg/src/nestegg.c +++ b/media/libnestegg/src/nestegg.c @@ -1406,7 +1406,7 @@ int nestegg_init(nestegg ** context, nestegg_io io, nestegg_log callback) { int r; - uint64_t id, version; + uint64_t id, version, docversion; struct ebml_list_node * track; char * doctype; nestegg * ctx = NULL; @@ -1446,13 +1446,31 @@ nestegg_init(nestegg ** context, nestegg_io io, nestegg_log callback) return -1; } - /* XXX youtube hack: accept webm and matroska for now */ - if (get_string(ctx->ebml.doctype, &doctype) == 0 && - (strcmp(doctype, "webm") == 0 || - strcmp(doctype, "matroska") == 0) && - get_uint(ctx->ebml.doctype_read_version, &version) == 0 && version <= 2 && - get_uint(ctx->ebml.ebml_read_version, &version) == 0 && version <= 1 && - !ctx->segment.tracks.track_entry.head) { + if (get_uint(ctx->ebml.ebml_read_version, &version) != 0) { + version = 1; + } + if (version != 1) { + nestegg_destroy(ctx); + return -1; + } + + if (get_string(ctx->ebml.doctype, &doctype) != 0) { + doctype = "matroska"; + } + if (strcmp(doctype, "webm") != 0) { + nestegg_destroy(ctx); + return -1; + } + + if (get_uint(ctx->ebml.doctype_read_version, &docversion) != 0) { + docversion = 1; + } + if (docversion < 1 || docversion > 2) { + nestegg_destroy(ctx); + return -1; + } + + if (!ctx->segment.tracks.track_entry.head) { nestegg_destroy(ctx); return -1; } @@ -1626,25 +1644,10 @@ nestegg_track_type(nestegg * ctx, unsigned int track) return -1; } -struct bitmapinfoheader { - int size; - int width; - int height; - short planes; - short bit_count; - unsigned int compression; - int size_image; - int x_pels_per_meter; - int y_pels_per_meter; - int clr_used; - int clr_important; -}; - int nestegg_track_codec_id(nestegg * ctx, unsigned int track) { char * codec_id; - struct ebml_binary codec_private; struct track_entry * entry; entry = find_track_entry(ctx, track); @@ -1660,15 +1663,6 @@ nestegg_track_codec_id(nestegg * ctx, unsigned int track) if (strcmp(codec_id, "A_VORBIS") == 0) return NESTEGG_CODEC_VORBIS; - /* XXX youtube hack: accept VFW codec id for now */ - if (strcmp(codec_id, "V_MS/VFW/FOURCC") == 0 && - get_binary(entry->codec_private, &codec_private) == 0 && - codec_private.length >= 40) { - struct bitmapinfoheader * bih = (struct bitmapinfoheader *) codec_private.data; - if (bih->compression == 0x30385056) - return NESTEGG_CODEC_VP8; - } - return -1; }