diff --git a/ChangeLog b/ChangeLog index a96ca0929..f0a39588b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-10-18 Moritz Bunkus + + * mkvinfo: new feature: Dump unknown elements recursively. + 2003-10-15 Moritz Bunkus * mkvmerge: bug fix: Made the SRT reader more tolerant regarding diff --git a/src/mkvinfo.cpp b/src/mkvinfo.cpp index 6dec2a92d..0b1e88604 100644 --- a/src/mkvinfo.cpp +++ b/src/mkvinfo.cpp @@ -156,11 +156,20 @@ void show_error(const char *fmt, ...) { mxinfo("(%s) %s\n", NAME, args_buffer); } +#define show_warning(l, f, args...) _show_element(NULL, NULL, false, l, f, \ + ## args) +#define show_unknown_element(e, l) \ + _show_element(e, es, true, l, "Unknown element: %s", e->Generic().DebugName) +#define show_element(e, l, s, args...) _show_element(e, es, false, l, s, \ + ## args) + void _show_element(EbmlElement *l, EbmlStream *es, bool skip, int level, const char *fmt, ...) { va_list ap; char level_buffer[10]; string new_fmt; + EbmlMaster *m; + int i; if (level > 9) die("mkvinfo.cpp/show_element(): level > 9: %d", level); @@ -189,17 +198,16 @@ void _show_element(EbmlElement *l, EbmlStream *es, bool skip, int level, } #endif // HAVE_WXWINDOWS - if ((l != NULL) && skip) + if ((l != NULL) && skip) { + // Dump unknown elements recursively. + m = dynamic_cast(l); + if (m != NULL) + for (i = 0; i < m->ListSize(); i++) + show_unknown_element((*m)[i], level + 1); l->SkipData(*es, l->Generic().Context); + } } -#define show_warning(l, f, args...) _show_element(NULL, NULL, false, l, f, \ - ## args) -#define show_unknown_element(e, l) \ - _show_element(e, es, true, l, "Unknown element: %s", e->Generic().DebugName) -#define show_element(e, l, s, args...) _show_element(e, es, false, l, s, \ - ## args) - // }}} // {{{ FUNCTION parse_args