Make libebml happy so that it will write elements which still have their default value.

This commit is contained in:
Moritz Bunkus 2005-06-24 10:36:55 +00:00
parent 019faeced2
commit 2d22769e06

View File

@ -40,15 +40,22 @@ fix_mandatory_tag_elements(EbmlElement *e) {
if (dynamic_cast<KaxTag *>(e) != NULL) { if (dynamic_cast<KaxTag *>(e) != NULL) {
KaxTag &t = *static_cast<KaxTag *>(e); KaxTag &t = *static_cast<KaxTag *>(e);
GetChild<KaxTagTargets>(t); GetChild<KaxTagTargets>(t);
GetChild<KaxTagSimple>(t);
} else if (dynamic_cast<KaxTagSimple *>(e) != NULL) { } else if (dynamic_cast<KaxTagSimple *>(e) != NULL) {
KaxTagSimple &s = *static_cast<KaxTagSimple *>(e); KaxTagSimple &s = *static_cast<KaxTagSimple *>(e);
GetChild<KaxTagLangue>(s); KaxTagName &n = GetChild<KaxTagName>(s);
GetChild<KaxTagDefault>(s); *static_cast<EbmlUnicodeString *>(&n) = UTFstring(n);
KaxTagLangue &l = GetChild<KaxTagLangue>(s);
*static_cast<EbmlString *>(&l) = string(l);
KaxTagDefault &d = GetChild<KaxTagDefault>(s);
*static_cast<EbmlUInteger *>(&d) = uint64(d);
} else if (dynamic_cast<KaxTagTargets *>(e) != NULL) { } else if (dynamic_cast<KaxTagTargets *>(e) != NULL) {
KaxTagTargets &t = *static_cast<KaxTagTargets *>(e); KaxTagTargets &t = *static_cast<KaxTagTargets *>(e);
GetChild<KaxTagTargetTypeValue>(t); GetChild<KaxTagTargetTypeValue>(t);
KaxTagTargetTypeValue &v = GetChild<KaxTagTargetTypeValue>(t);
*static_cast<EbmlUInteger *>(&v) = uint64(v);
} }