rename CLASS_INFO() to EBML_INFO() and CLASS_ID() to EBML_ID()

This commit is contained in:
Steve Lhomme 2010-03-12 18:51:38 +01:00 committed by Moritz Bunkus
parent a5c5ce2fdf
commit 79728809d4
18 changed files with 147 additions and 147 deletions

View File

@ -585,12 +585,12 @@ remove_entries(int64_t min_tc,
last_atom_at = i;
entries[i].is_atom = true;
KaxChapterTimeStart *cts = static_cast<KaxChapterTimeStart *>(atom->FindFirstElt(CLASS_INFO(KaxChapterTimeStart), false));
KaxChapterTimeStart *cts = static_cast<KaxChapterTimeStart *>(atom->FindFirstElt(EBML_INFO(KaxChapterTimeStart), false));
if (NULL != cts)
entries[i].start = uint64(*cts);
KaxChapterTimeEnd *cte = static_cast<KaxChapterTimeEnd *>(atom->FindFirstElt(CLASS_INFO(KaxChapterTimeEnd), false));
KaxChapterTimeEnd *cte = static_cast<KaxChapterTimeEnd *>(atom->FindFirstElt(EBML_INFO(KaxChapterTimeEnd), false));
if (NULL != cte)
entries[i].end = uint64(*cte);
@ -638,8 +638,8 @@ remove_entries(int64_t min_tc,
if (entries[i].remove && !entries[i].spans)
continue;
KaxChapterTimeStart *cts = static_cast<KaxChapterTimeStart *>(atom->FindFirstElt(CLASS_INFO(KaxChapterTimeStart), false));
KaxChapterTimeEnd *cte = static_cast<KaxChapterTimeEnd *>(atom->FindFirstElt(CLASS_INFO(KaxChapterTimeEnd), false));
KaxChapterTimeStart *cts = static_cast<KaxChapterTimeStart *>(atom->FindFirstElt(EBML_INFO(KaxChapterTimeStart), false));
KaxChapterTimeEnd *cte = static_cast<KaxChapterTimeEnd *>(atom->FindFirstElt(EBML_INFO(KaxChapterTimeEnd), false));
if (entries[i].spans)
*static_cast<EbmlUInteger *>(cts) = min_tc;

View File

@ -81,10 +81,10 @@ static void
end_chapter_atom(void *pdata) {
EbmlMaster *m = static_cast<EbmlMaster *>(xmlp_pelt);
if (m->FindFirstElt(CLASS_INFO(KaxChapterTimeStart), false) == NULL)
if (m->FindFirstElt(EBML_INFO(KaxChapterTimeStart), false) == NULL)
xmlp_error(CPDATA, Y("<ChapterAtom> is missing the <ChapterTimeStart> child."));
if (m->FindFirstElt(CLASS_INFO(KaxChapterUID), false) == NULL) {
if (m->FindFirstElt(EBML_INFO(KaxChapterUID), false) == NULL) {
KaxChapterUID *cuid = new KaxChapterUID;
*static_cast<EbmlUInteger *>(cuid) = create_unique_uint32(UNIQUE_CHAPTER_IDS);
m->PushElement(*cuid);
@ -95,7 +95,7 @@ static void
end_chapter_track(void *pdata) {
EbmlMaster *m = static_cast<EbmlMaster *>(xmlp_pelt);
if (m->FindFirstElt(CLASS_INFO(KaxChapterTrackNumber), false) == NULL)
if (m->FindFirstElt(EBML_INFO(KaxChapterTrackNumber), false) == NULL)
xmlp_error(CPDATA, Y("<ChapterTrack> is missing the <ChapterTrackNumber> child."));
}
@ -103,10 +103,10 @@ static void
end_chapter_display(void *pdata) {
EbmlMaster *m = static_cast<EbmlMaster *>(xmlp_pelt);
if (m->FindFirstElt(CLASS_INFO(KaxChapterString), false) == NULL)
if (m->FindFirstElt(EBML_INFO(KaxChapterString), false) == NULL)
xmlp_error(CPDATA, Y("<ChapterDisplay> is missing the <ChapterString> child."));
if (m->FindFirstElt(CLASS_INFO(KaxChapterLanguage), false) == NULL) {
if (m->FindFirstElt(EBML_INFO(KaxChapterLanguage), false) == NULL) {
KaxChapterLanguage *cl = new KaxChapterLanguage;
*static_cast<EbmlString *>(cl) = "und";
m->PushElement(*cl);

View File

@ -45,15 +45,15 @@ int MTX_DLL_API kt_get_a_bps(KaxTrackEntry &track);
int MTX_DLL_API kt_get_v_pixel_width(KaxTrackEntry &track);
int MTX_DLL_API kt_get_v_pixel_height(KaxTrackEntry &track);
#define is_id(e, ref) (EbmlId(*e) == CLASS_ID(ref))
#if !defined(CLASS_INFO)
#define CLASS_INFO(ref) ref::ClassInfos
#define is_id(e, ref) (EbmlId(*e) == EBML_ID(ref))
#if !defined(EBML_INFO)
#define EBML_INFO(ref) ref::ClassInfos
#endif
#if !defined(CLASS_ID)
#define CLASS_ID(ref) ref::ClassInfos.GlobalId
#if !defined(EBML_ID)
#define EBML_ID(ref) ref::ClassInfos.GlobalId
#endif
#define FINDFIRST(p, c) (static_cast<c *>(((EbmlMaster *)p)->FindFirstElt(CLASS_INFO(c), false)))
#define FINDFIRST(p, c) (static_cast<c *>(((EbmlMaster *)p)->FindFirstElt(EBML_INFO(c), false)))
#define FINDNEXT(p, c, e) (static_cast<c *>(((EbmlMaster *)p)->FindNextElt(*e, false)))
template <typename type>type &
@ -61,7 +61,7 @@ GetEmptyChild(EbmlMaster &master) {
EbmlElement *e;
EbmlMaster *m;
e = master.FindFirstElt(CLASS_INFO(type), true);
e = master.FindFirstElt(EBML_INFO(type), true);
if ((m = dynamic_cast<EbmlMaster *>(e)) != NULL) {
while (m->ListSize() > 0) {
delete (*m)[0];

View File

@ -43,10 +43,10 @@ operator <(const kax_analyzer_data_cptr &d1,
std::string
kax_analyzer_data_c::to_string() const {
const EbmlCallbacks *callbacks = find_ebml_callbacks(CLASS_INFO(KaxSegment), m_id);
const EbmlCallbacks *callbacks = find_ebml_callbacks(EBML_INFO(KaxSegment), m_id);
if ((NULL == callbacks) && (CLASS_ID(EbmlVoid) == m_id))
callbacks = &CLASS_INFO(EbmlVoid);
if ((NULL == callbacks) && (EBML_ID(EbmlVoid) == m_id))
callbacks = &EBML_INFO(EbmlVoid);
std::string name;
if (NULL != callbacks)
@ -203,7 +203,7 @@ kax_analyzer_c::process(kax_analyzer_c::parse_mode_e parse_mode,
m_stream = new EbmlStream(*m_file);
// Find the EbmlHead element. Must be the first one.
EbmlElement *l0 = m_stream->FindNextID(CLASS_INFO(EbmlHead), 0xFFFFFFFFL);
EbmlElement *l0 = m_stream->FindNextID(EBML_INFO(EbmlHead), 0xFFFFFFFFL);
if (NULL == l0)
throw error_c(Y("Not a valid Matroska file (no EBML head found)"));
@ -213,11 +213,11 @@ kax_analyzer_c::process(kax_analyzer_c::parse_mode_e parse_mode,
while (1) {
// Next element must be a segment
l0 = m_stream->FindNextID(CLASS_INFO(KaxSegment), 0xFFFFFFFFFFFFFFFFLL);
l0 = m_stream->FindNextID(EBML_INFO(KaxSegment), 0xFFFFFFFFFFFFFFFFLL);
if (NULL == l0)
throw error_c(Y("Not a valid Matroska file (no segment/level 0 element found)"));
if (EbmlId(*l0) == CLASS_ID(KaxSegment))
if (EbmlId(*l0) == EBML_ID(KaxSegment))
break;
l0->SkipData(*m_stream, l0->Generic().Context);
@ -278,7 +278,7 @@ kax_analyzer_c::read_element(kax_analyzer_data_c *element_data) {
int upper_lvl_el = 0;
EbmlElement *e = es.FindNextElement(m_segment->Generic().Context, upper_lvl_el, 0xFFFFFFFFL, true, 1);
const EbmlCallbacks *callbacks = find_ebml_callbacks(CLASS_INFO(KaxSegment), element_data->m_id);
const EbmlCallbacks *callbacks = find_ebml_callbacks(EBML_INFO(KaxSegment), element_data->m_id);
if ((NULL == e) || (NULL == callbacks) || (EbmlId(*e) != callbacks->GlobalId)) {
delete e;
@ -413,7 +413,7 @@ kax_analyzer_c::handle_void_elements(int data_idx) {
// Are the following elements EbmlVoid elements?
int end_idx = data_idx + 1;
while ((m_data.size() > end_idx) && (m_data[end_idx]->m_id == CLASS_ID(EbmlVoid)))
while ((m_data.size() > end_idx) && (m_data[end_idx]->m_id == EBML_ID(EbmlVoid)))
++end_idx;
if (end_idx > data_idx + 1)
@ -484,7 +484,7 @@ kax_analyzer_c::handle_void_elements(int data_idx) {
evoid.SetSize(void_size - evoid.HeadSize());
evoid.Render(*m_file);
m_data.insert(m_data.begin() + data_idx + 1, kax_analyzer_data_c::create(CLASS_ID(EbmlVoid), void_pos, void_size));
m_data.insert(m_data.begin() + data_idx + 1, kax_analyzer_data_c::create(EBML_ID(EbmlVoid), void_pos, void_size));
// Now check if we should overwrite the current element with the
// EbmlVoid element. That is the case if the current element's size
@ -512,7 +512,7 @@ kax_analyzer_c::remove_from_meta_seeks(EbmlId id) {
for (data_idx = 0; m_data.size() > data_idx; ++data_idx) {
// We only have to do work on SeekHead elements. Skip the others.
if (m_data[data_idx]->m_id != CLASS_ID(KaxSeekHead))
if (m_data[data_idx]->m_id != EBML_ID(KaxSeekHead))
continue;
// Read the element from the m_file. Remember its size so that a new
@ -528,7 +528,7 @@ kax_analyzer_c::remove_from_meta_seeks(EbmlId id) {
bool modified = false;
int sh_idx = 0;
while (seek_head->ListSize() > sh_idx) {
if (EbmlId(*(*seek_head)[sh_idx]) != CLASS_ID(KaxSeek)) {
if (EbmlId(*(*seek_head)[sh_idx]) != EBML_ID(KaxSeek)) {
++sh_idx;
continue;
}
@ -609,7 +609,7 @@ kax_analyzer_c::merge_void_elements() {
while (m_data.size() > start_idx) {
// We only have to do work on EbmlVoid elements. Skip the others.
if (m_data[start_idx]->m_id != CLASS_ID(EbmlVoid)) {
if (m_data[start_idx]->m_id != EBML_ID(EbmlVoid)) {
++start_idx;
continue;
}
@ -618,7 +618,7 @@ kax_analyzer_c::merge_void_elements() {
// there are at this position and calculate the combined size.
int end_idx = start_idx + 1;
int new_size = m_data[start_idx]->m_size;
while ((m_data.size() > end_idx) && (m_data[end_idx]->m_id == CLASS_ID(EbmlVoid))) {
while ((m_data.size() > end_idx) && (m_data[end_idx]->m_id == EBML_ID(EbmlVoid))) {
new_size += m_data[end_idx]->m_size;
++end_idx;
}
@ -648,7 +648,7 @@ kax_analyzer_c::merge_void_elements() {
// See how many void elements there are at the end of the m_file.
start_idx = m_data.size() - 1;
while ((0 <= start_idx) && (CLASS_ID(EbmlVoid) == m_data[start_idx]->m_id))
while ((0 <= start_idx) && (EBML_ID(EbmlVoid) == m_data[start_idx]->m_id))
--start_idx;
++start_idx;
@ -687,7 +687,7 @@ kax_analyzer_c::write_element(EbmlElement *e,
int data_idx;
for (data_idx = 0; m_data.size() > data_idx; ++data_idx) {
// We're only interested in EbmlVoid elements. Skip the others.
if (m_data[data_idx]->m_id != CLASS_ID(EbmlVoid))
if (m_data[data_idx]->m_id != EBML_ID(EbmlVoid))
continue;
// Skip the element if it doesn't provide enough space.
@ -737,7 +737,7 @@ kax_analyzer_c::add_to_meta_seek(EbmlElement *e) {
for (data_idx = 0; m_data.size() > data_idx; ++data_idx) {
// We only have to do work on SeekHead elements. Skip the others.
if (m_data[data_idx]->m_id != CLASS_ID(KaxSeekHead))
if (m_data[data_idx]->m_id != EBML_ID(KaxSeekHead))
continue;
// Calculate how much free space there is behind the seek head.
@ -746,7 +746,7 @@ kax_analyzer_c::add_to_meta_seek(EbmlElement *e) {
// have been merged into a single element.
int available_space = m_data[data_idx]->m_size;
bool void_present = false;
if (((data_idx + 1) < m_data.size()) && (m_data[data_idx + 1]->m_id == CLASS_ID(EbmlVoid))) {
if (((data_idx + 1) < m_data.size()) && (m_data[data_idx + 1]->m_id == EBML_ID(EbmlVoid))) {
available_space += m_data[data_idx + 1]->m_size;
void_present = true;
}
@ -813,7 +813,7 @@ kax_analyzer_c::add_to_meta_seek(EbmlElement *e) {
seek_head->Render(*m_file, true);
// ...and update the internal records.
m_data.push_back(kax_analyzer_data_c::create(CLASS_ID(KaxSeekHead), seek_head->GetElementPosition(), seek_head->ElementSize(true)));
m_data.push_back(kax_analyzer_data_c::create(EBML_ID(KaxSeekHead), seek_head->GetElementPosition(), seek_head->ElementSize(true)));
// Update the m_segment size.
adjust_segment_size();
@ -846,7 +846,7 @@ kax_analyzer_c::add_to_meta_seek(EbmlElement *e) {
for (data_idx = 0; m_data.size() > data_idx; ++data_idx) {
// We can only overwrite void elements. Skip the others.
if (m_data[data_idx]->m_id != CLASS_ID(EbmlVoid))
if (m_data[data_idx]->m_id != EBML_ID(EbmlVoid))
continue;
// Skip the element if it doesn't offer enough space for the seek head.
@ -859,7 +859,7 @@ kax_analyzer_c::add_to_meta_seek(EbmlElement *e) {
// Adjust the internal records for the new seek head.
m_data[data_idx]->m_size = new_seek_head->ElementSize(true);
m_data[data_idx]->m_id = CLASS_ID(KaxSeekHead);
m_data[data_idx]->m_id = EBML_ID(KaxSeekHead);
// Write a void element after the newly written seek head in order to
// cover the space previously occupied by the old void element.
@ -890,7 +890,7 @@ kax_analyzer_c::read_all(const EbmlCallbacks &callbacks) {
m_file->setFilePointer(data.m_pos);
int upper_lvl_el = 0;
EbmlElement *element = es.FindNextElement(CLASS_INFO(KaxSegment).Context, upper_lvl_el, 0xFFFFFFFFL, true);
EbmlElement *element = es.FindNextElement(EBML_INFO(KaxSegment).Context, upper_lvl_el, 0xFFFFFFFFL, true);
if (NULL == element)
continue;
@ -933,7 +933,7 @@ kax_analyzer_c::read_all_meta_seeks() {
positions_found[m_data[i]->m_pos] = true;
for (i = 0; i < num_entries; i++)
if (CLASS_ID(KaxSeekHead) == m_data[i]->m_id)
if (EBML_ID(KaxSeekHead) == m_data[i]->m_id)
read_meta_seek(m_data[i]->m_pos, positions_found);
sort(m_data.begin(), m_data.end());
@ -983,7 +983,7 @@ kax_analyzer_c::read_meta_seek(int64_t pos,
m_data.push_back(kax_analyzer_data_c::create(the_id, seek_pos, -1));
positions_found[seek_pos] = true;
if (CLASS_ID(KaxSeekHead) == the_id)
if (EBML_ID(KaxSeekHead) == the_id)
read_meta_seek(seek_pos, positions_found);
}

View File

@ -105,14 +105,14 @@ kax_file_c::read_next_level1_element_internal(uint32_t wanted_id) {
EbmlElement *
kax_file_c::read_one_element() {
int upper_lvl_el = 0;
EbmlElement *l1 = m_es->FindNextElement(CLASS_INFO(KaxSegment).Context, upper_lvl_el, 0xFFFFFFFFL, true);
EbmlElement *l1 = m_es->FindNextElement(EBML_INFO(KaxSegment).Context, upper_lvl_el, 0xFFFFFFFFL, true);
if (NULL == l1)
return NULL;
const EbmlCallbacks *callbacks = find_ebml_callbacks(CLASS_INFO(KaxSegment), EbmlId(*l1));
const EbmlCallbacks *callbacks = find_ebml_callbacks(EBML_INFO(KaxSegment), EbmlId(*l1));
if (NULL == callbacks)
callbacks = &CLASS_INFO(KaxSegment);
callbacks = &EBML_INFO(KaxSegment);
EbmlElement *l2 = NULL;
l1->Read(*m_es.get_object(), callbacks->Context, upper_lvl_el, l2, true);
@ -123,7 +123,7 @@ kax_file_c::read_one_element() {
bool
kax_file_c::is_level1_element_id(vint_c id) const {
const EbmlSemanticContext &context = CLASS_INFO(KaxSegment).Context;
const EbmlSemanticContext &context = EBML_INFO(KaxSegment).Context;
for (int segment_idx = 0; context.Size > segment_idx; ++segment_idx)
if (context.MyTable[segment_idx].GetCallbacks.GlobalId.Value == id.m_value)
return true;
@ -133,8 +133,8 @@ kax_file_c::is_level1_element_id(vint_c id) const {
bool
kax_file_c::is_global_element_id(vint_c id) const {
return (CLASS_ID(EbmlVoid).Value() == id.m_value)
|| (CLASS_ID(EbmlCrc32).Value() == id.m_value);
return (EBML_ID(EbmlVoid).Value() == id.m_value)
|| (EBML_ID(EbmlCrc32).Value() == id.m_value);
}
EbmlElement *
@ -210,12 +210,12 @@ kax_file_c::resync_to_level1_element_internal(uint32_t wanted_id) {
KaxCluster *
kax_file_c::resync_to_cluster() {
return static_cast<KaxCluster *>(resync_to_level1_element(CLASS_ID(KaxCluster).Value));
return static_cast<KaxCluster *>(resync_to_level1_element(EBML_ID(KaxCluster).Value));
}
KaxCluster *
kax_file_c::read_next_cluster() {
return static_cast<KaxCluster *>(read_next_level1_element(CLASS_ID(KaxCluster).Value));
return static_cast<KaxCluster *>(read_next_level1_element(EBML_ID(KaxCluster).Value));
}
bool

View File

@ -40,10 +40,10 @@ end_segmentinfo_data(void *) {
EbmlMaster *m;
m = static_cast<EbmlMaster *>(xmlp_pelt);
if (m->FindFirstElt(CLASS_INFO(KaxChapterString), false) == NULL)
if (m->FindFirstElt(EBML_INFO(KaxChapterString), false) == NULL)
xmlp_error(CPDATA, "<ChapterDisplay> is missing the <ChapterString> "
"child.");
if (m->FindFirstElt(CLASS_INFO(KaxChapterLanguage), false) == NULL) {
if (m->FindFirstElt(EBML_INFO(KaxChapterLanguage), false) == NULL) {
KaxChapterLanguage *cl;
cl = new KaxChapterLanguage;

View File

@ -116,14 +116,14 @@ find_simple_tag(const UTFstring &name,
int i;
std::string rvalue;
if (EbmlId(m) == CLASS_ID(KaxTagSimple)) {
if (EbmlId(m) == EBML_ID(KaxTagSimple)) {
KaxTagName *tname = FINDFIRST(&m, KaxTagName);
if ((NULL != tname) && (name == UTFstring(*tname)))
return *static_cast<KaxTagSimple *>(&m);
}
for (i = 0; i < m.ListSize(); i++)
if ((EbmlId(*m[i]) == CLASS_ID(KaxTag)) || (EbmlId(*m[i]) == CLASS_ID(KaxTagSimple))) {
if ((EbmlId(*m[i]) == EBML_ID(KaxTag)) || (EbmlId(*m[i]) == EBML_ID(KaxTagSimple))) {
try {
return find_simple_tag(name, *static_cast<EbmlMaster *>(m[i]));
} catch (...) {

View File

@ -41,7 +41,7 @@ init_mapping_table(parser_element_t *table) {
continue;
debug_name = table[i].debug_name != NULL ? table[i].debug_name :
table[i].name;
result = find_ebml_callbacks(CLASS_INFO(KaxSegment), debug_name);
result = find_ebml_callbacks(EBML_INFO(KaxSegment), debug_name);
if (NULL == result)
mxerror(boost::format(Y("Error initializing the tables for the chapter, tag and segment info elements: "
"Could not find the element with the debug name '%1%'. %2%\n")) % debug_name % BUGMSG);

View File

@ -270,7 +270,7 @@ add_new_element(parser_data_t *pdata,
xmlp_error(pdata, boost::format(Y("<%1%> is not a valid child element of <%2%>.")) % name % pdata->mapping[parent_idx].name);
if (0 < pdata->depth) {
const EbmlCallbacks *callbacks = find_ebml_callbacks(CLASS_INFO(KaxSegment), pdata->mapping[parent_idx].id);
const EbmlCallbacks *callbacks = find_ebml_callbacks(EBML_INFO(KaxSegment), pdata->mapping[parent_idx].id);
bool found = false;
if (NULL != callbacks) {
@ -286,7 +286,7 @@ add_new_element(parser_data_t *pdata,
if (!found)
xmlp_error(pdata, boost::format(Y("<%1%> is not a valid child element of <%2%>.")) % name % pdata->mapping[parent_idx].name);
const EbmlSemantic *semantic = find_ebml_semantic(CLASS_INFO(KaxSegment), pdata->mapping[elt_idx].id);
const EbmlSemantic *semantic = find_ebml_semantic(EBML_INFO(KaxSegment), pdata->mapping[elt_idx].id);
if ((NULL != semantic) && semantic->Unique) {
EbmlMaster *m = dynamic_cast<EbmlMaster *>(xmlp_pelt);
assert(NULL != m);
@ -298,7 +298,7 @@ add_new_element(parser_data_t *pdata,
}
}
EbmlElement *e = create_ebml_element(CLASS_INFO(KaxSegment), pdata->mapping[elt_idx].id);
EbmlElement *e = create_ebml_element(EBML_INFO(KaxSegment), pdata->mapping[elt_idx].id);
assert(NULL != e);
if (0 == pdata->depth) {

View File

@ -57,16 +57,16 @@ handle_attachments(KaxAttachments *atts,
for (k = 0; att->ListSize() > k; ++k) {
EbmlElement *e = (*att)[k];
if (EbmlId(*e) == CLASS_ID(KaxFileName))
if (EbmlId(*e) == EBML_ID(KaxFileName))
name = UTFstring_to_cstrutf8(UTFstring(*static_cast<KaxFileName *>(e)));
else if (EbmlId(*e) == CLASS_ID(KaxMimeType))
else if (EbmlId(*e) == EBML_ID(KaxMimeType))
type = std::string(*static_cast<KaxMimeType *>(e));
else if (EbmlId(*e) == CLASS_ID(KaxFileUID))
else if (EbmlId(*e) == EBML_ID(KaxFileUID))
id = uint32(*static_cast<KaxFileUID *>(e));
else if (EbmlId(*e) == CLASS_ID(KaxFileData)) {
else if (EbmlId(*e) == EBML_ID(KaxFileData)) {
fdata = (KaxFileData *)e;
size = fdata->GetSize();
}
@ -120,7 +120,7 @@ extract_attachments(const std::string &file_name,
return;
}
KaxAttachments *attachments = dynamic_cast<KaxAttachments *>(analyzer->read_all(CLASS_INFO(KaxAttachments)));
KaxAttachments *attachments = dynamic_cast<KaxAttachments *>(analyzer->read_all(EBML_INFO(KaxAttachments)));
if (NULL != attachments) {
handle_attachments(attachments, tracks);
delete attachments;

View File

@ -53,7 +53,7 @@ extract_chapters(const std::string &file_name,
return;
}
EbmlMaster *master = analyzer->read_all(CLASS_INFO(KaxChapters));
EbmlMaster *master = analyzer->read_all(EBML_INFO(KaxChapters));
if (NULL == master)
return;

View File

@ -49,7 +49,7 @@ find_tag_for_track(int idx,
int i;
for (i = 0; i < m.ListSize(); i++) {
if (EbmlId(*m[i]) != CLASS_ID(KaxTag))
if (EbmlId(*m[i]) != EBML_ID(KaxTag))
continue;
int64_t tag_cuid = get_tag_cuid(*static_cast<KaxTag *>(m[i]));
@ -84,7 +84,7 @@ get_chapter_index(int idx,
int i;
std::string sidx = (boost::format("INDEX %|1$02d|") % idx).str();
for (i = 0; i < atom.ListSize(); i++)
if ((EbmlId(*atom[i]) == CLASS_ID(KaxChapterAtom)) &&
if ((EbmlId(*atom[i]) == EBML_ID(KaxChapterAtom)) &&
(get_chapter_name(*static_cast<KaxChapterAtom *>(atom[i])) == sidx))
return get_chapter_start(*static_cast<KaxChapterAtom *>(atom[i]));
@ -211,8 +211,8 @@ extract_cuesheet(const std::string &file_name,
}
KaxChapters all_chapters;
KaxChapters *chapters = dynamic_cast<KaxChapters *>(analyzer->read_all(CLASS_INFO(KaxChapters)));
KaxTags *all_tags = dynamic_cast<KaxTags *>(analyzer->read_all(CLASS_INFO(KaxTags)));
KaxChapters *chapters = dynamic_cast<KaxChapters *>(analyzer->read_all(EBML_INFO(KaxChapters)));
KaxTags *all_tags = dynamic_cast<KaxTags *>(analyzer->read_all(EBML_INFO(KaxTags)));
if ((NULL != chapters) && (NULL != all_tags)) {
int i;

View File

@ -53,7 +53,7 @@ extract_tags(const std::string &file_name,
return;
}
EbmlMaster *m = analyzer->read_all(CLASS_INFO(KaxTags));
EbmlMaster *m = analyzer->read_all(EBML_INFO(KaxTags));
if (NULL != m) {
KaxTags *tags = dynamic_cast<KaxTags *>(m);
assert(NULL != tags);

View File

@ -178,7 +178,7 @@ extract_timecodes(const std::string &file_name,
EbmlStream *es = new EbmlStream(*in);
// Find the EbmlHead element. Must be the first one.
EbmlElement *l0 = es->FindNextID(CLASS_INFO(EbmlHead), 0xFFFFFFFFL);
EbmlElement *l0 = es->FindNextID(EBML_INFO(EbmlHead), 0xFFFFFFFFL);
if (l0 == NULL) {
show_error(Y("Error: No EBML head found."));
delete es;
@ -192,12 +192,12 @@ extract_timecodes(const std::string &file_name,
while (1) {
// Next element must be a segment
l0 = es->FindNextID(CLASS_INFO(KaxSegment), 0xFFFFFFFFFFFFFFFFLL);
l0 = es->FindNextID(EBML_INFO(KaxSegment), 0xFFFFFFFFFFFFFFFFLL);
if (NULL == l0) {
show_error(Y("No segment/level 0 element found."));
return;
}
if (EbmlId(*l0) == CLASS_ID(KaxSegment)) {
if (EbmlId(*l0) == EBML_ID(KaxSegment)) {
show_element(l0, 0, Y("Segment"));
break;
}
@ -216,14 +216,14 @@ extract_timecodes(const std::string &file_name,
EbmlElement *l3 = NULL;
while ((NULL != l1) && (0 >= upper_lvl_el)) {
if (EbmlId(*l1) == CLASS_ID(KaxInfo)) {
if (EbmlId(*l1) == EBML_ID(KaxInfo)) {
// General info about this Matroska file
show_element(l1, 1, Y("Segment information"));
upper_lvl_el = 0;
l2 = es->FindNextElement(l1->Generic().Context, upper_lvl_el, 0xFFFFFFFFL, true, 1);
while ((NULL != l2) && (0 >= upper_lvl_el)) {
if (EbmlId(*l2) == CLASS_ID(KaxTimecodeScale)) {
if (EbmlId(*l2) == EBML_ID(KaxTimecodeScale)) {
KaxTimecodeScale &ktc_scale = *static_cast<KaxTimecodeScale *>(l2);
ktc_scale.ReadData(es->I_O());
tc_scale = uint64(ktc_scale);
@ -248,17 +248,17 @@ extract_timecodes(const std::string &file_name,
l2 = es->FindNextElement(l1->Generic().Context, upper_lvl_el, 0xFFFFFFFFL, true);
}
} else if ((EbmlId(*l1) == CLASS_ID(KaxTracks)) && !tracks_found) {
} else if ((EbmlId(*l1) == EBML_ID(KaxTracks)) && !tracks_found) {
// Yep, we've found our KaxTracks element. Now find all tracks
// contained in this segment.
show_element(l1, 1, Y("Segment tracks"));
tracks_found = true;
l1->Read(*es, CLASS_INFO(KaxTracks).Context, upper_lvl_el, l2, true);
l1->Read(*es, EBML_INFO(KaxTracks).Context, upper_lvl_el, l2, true);
create_timecode_files(*dynamic_cast<KaxTracks *>(l1), tspecs, version);
} else if (EbmlId(*l1) == CLASS_ID(KaxCluster)) {
} else if (EbmlId(*l1) == EBML_ID(KaxCluster)) {
show_element(l1, 1, Y("Cluster"));
KaxCluster *cluster = (KaxCluster *)l1;
uint64_t cluster_tc = 0;
@ -270,23 +270,23 @@ extract_timecodes(const std::string &file_name,
l2 = es->FindNextElement(l1->Generic().Context, upper_lvl_el, 0xFFFFFFFFL, true, 1);
while ((NULL != l2) && (0 >= upper_lvl_el)) {
if (EbmlId(*l2) == CLASS_ID(KaxClusterTimecode)) {
if (EbmlId(*l2) == EBML_ID(KaxClusterTimecode)) {
KaxClusterTimecode &ctc = *static_cast<KaxClusterTimecode *>(l2);
ctc.ReadData(es->I_O());
cluster_tc = uint64(ctc);
show_element(l2, 2, boost::format(Y("Cluster timecode: %|1$.3f|s")) % ((float)cluster_tc * (float)tc_scale / 1000000000.0));
cluster->InitTimecode(cluster_tc, tc_scale);
} else if (EbmlId(*l2) == CLASS_ID(KaxBlockGroup)) {
} else if (EbmlId(*l2) == EBML_ID(KaxBlockGroup)) {
show_element(l2, 2, Y("Block group"));
l2->Read(*es, CLASS_INFO(KaxBlockGroup).Context, upper_lvl_el, l3, true);
l2->Read(*es, EBML_INFO(KaxBlockGroup).Context, upper_lvl_el, l3, true);
handle_blockgroup(*static_cast<KaxBlockGroup *>(l2), *cluster, tc_scale);
} else if (EbmlId(*l2) == CLASS_ID(KaxSimpleBlock)) {
} else if (EbmlId(*l2) == EBML_ID(KaxSimpleBlock)) {
show_element(l2, 2, Y("Simple block"));
l2->Read(*es, CLASS_INFO(KaxSimpleBlock).Context, upper_lvl_el, l3, true);
l2->Read(*es, EBML_INFO(KaxSimpleBlock).Context, upper_lvl_el, l3, true);
handle_simpleblock(*static_cast<KaxSimpleBlock *>(l2), *cluster);
} else

View File

@ -326,7 +326,7 @@ extract_tracks(const std::string &file_name,
EbmlStream *es = new EbmlStream(*in);
// Find the EbmlHead element. Must be the first one.
EbmlElement *l0 = es->FindNextID(CLASS_INFO(EbmlHead), 0xFFFFFFFFL);
EbmlElement *l0 = es->FindNextID(EBML_INFO(EbmlHead), 0xFFFFFFFFL);
if (NULL == l0) {
show_error(Y("Error: No EBML head found."));
delete es;
@ -340,14 +340,14 @@ extract_tracks(const std::string &file_name,
while (1) {
// Next element must be a segment
l0 = es->FindNextID(CLASS_INFO(KaxSegment), 0xFFFFFFFFFFFFFFFFLL);
l0 = es->FindNextID(EBML_INFO(KaxSegment), 0xFFFFFFFFFFFFFFFFLL);
if (NULL == l0) {
show_error(Y("No segment/level 0 element found."));
return false;
}
if (EbmlId(*l0) == CLASS_ID(KaxSegment)) {
if (EbmlId(*l0) == EBML_ID(KaxSegment)) {
show_element(l0, 0, Y("Segment"));
break;
}
@ -366,7 +366,7 @@ extract_tracks(const std::string &file_name,
while (NULL != (l1 = file->read_next_level1_element())) {
int64_t element_end_pos = l1->GetElementPosition() + l1->ElementSize();
if (EbmlId(*l1) == CLASS_ID(KaxInfo)) {
if (EbmlId(*l1) == EBML_ID(KaxInfo)) {
// General info about this Matroska file
show_element(l1, 1, Y("Segment information"));
@ -376,7 +376,7 @@ extract_tracks(const std::string &file_name,
show_element(ktc_scale, 2, boost::format(Y("Timecode scale: %1%")) % tc_scale);
}
} else if ((EbmlId(*l1) == CLASS_ID(KaxTracks)) && !tracks_found) {
} else if ((EbmlId(*l1) == EBML_ID(KaxTracks)) && !tracks_found) {
// Yep, we've found our KaxTracks element. Now find all tracks
// contained in this segment.
@ -386,7 +386,7 @@ extract_tracks(const std::string &file_name,
find_track_uids(*dynamic_cast<KaxTracks *>(l1), tspecs);
create_extractors(*dynamic_cast<KaxTracks *>(l1), tspecs);
} else if (EbmlId(*l1) == CLASS_ID(KaxCluster)) {
} else if (EbmlId(*l1) == EBML_ID(KaxCluster)) {
show_element(l1, 1, Y("Cluster"));
KaxCluster *cluster = static_cast<KaxCluster *>(l1);
@ -403,24 +403,24 @@ extract_tracks(const std::string &file_name,
int i;
for (i = 0; cluster->ListSize() > i; ++i) {
EbmlElement *el = (*cluster)[i];
if (EbmlId(*el) == CLASS_ID(KaxBlockGroup)) {
if (EbmlId(*el) == EBML_ID(KaxBlockGroup)) {
show_element(el, 2, Y("Block group"));
handle_blockgroup(*static_cast<KaxBlockGroup *>(el), *cluster, tc_scale);
} else if (EbmlId(*el) == CLASS_ID(KaxSimpleBlock)) {
} else if (EbmlId(*el) == EBML_ID(KaxSimpleBlock)) {
show_element(el, 2, Y("SimpleBlock"));
handle_simpleblock(*static_cast<KaxSimpleBlock *>(el), *cluster);
}
}
} else if (EbmlId(*l1) == CLASS_ID(KaxChapters)) {
} else if (EbmlId(*l1) == EBML_ID(KaxChapters)) {
KaxChapters &chapters = *static_cast<KaxChapters *>(l1);
while (chapters.ListSize() > 0) {
if (EbmlId(*chapters[0]) == CLASS_ID(KaxEditionEntry)) {
if (EbmlId(*chapters[0]) == EBML_ID(KaxEditionEntry)) {
KaxEditionEntry &entry = *static_cast<KaxEditionEntry *>(chapters[0]);
while (entry.ListSize() > 0) {
if (EbmlId(*entry[0]) == CLASS_ID(KaxChapterAtom))
if (EbmlId(*entry[0]) == EBML_ID(KaxChapterAtom))
all_chapters.PushElement(*entry[0]);
entry.Remove(0);
}
@ -428,7 +428,7 @@ extract_tracks(const std::string &file_name,
chapters.Remove(0);
}
} else if (EbmlId(*l1) == CLASS_ID(KaxTags)) {
} else if (EbmlId(*l1) == EBML_ID(KaxTags)) {
KaxTags &tags = *static_cast<KaxTags *>(l1);
while (tags.ListSize() > 0) {

View File

@ -1130,14 +1130,14 @@ def_handle(seek_head) {
show_element(l3, 3,
boost::format(Y("Seek ID:%1% (%2%)"))
% to_hex(seek_id.GetBuffer(), seek_id.GetSize())
% ( CLASS_ID(KaxInfo) == id ? "KaxInfo"
: CLASS_ID(KaxCluster) == id ? "KaxCluster"
: CLASS_ID(KaxTracks) == id ? "KaxTracks"
: CLASS_ID(KaxCues) == id ? "KaxCues"
: CLASS_ID(KaxAttachments) == id ? "KaxAttachments"
: CLASS_ID(KaxChapters) == id ? "KaxChapters"
: CLASS_ID(KaxTags) == id ? "KaxTags"
: CLASS_ID(KaxSeekHead) == id ? "KaxSeekHead"
% ( EBML_ID(KaxInfo) == id ? "KaxInfo"
: EBML_ID(KaxCluster) == id ? "KaxCluster"
: EBML_ID(KaxTracks) == id ? "KaxTracks"
: EBML_ID(KaxCues) == id ? "KaxCues"
: EBML_ID(KaxAttachments) == id ? "KaxAttachments"
: EBML_ID(KaxChapters) == id ? "KaxChapters"
: EBML_ID(KaxTags) == id ? "KaxTags"
: EBML_ID(KaxSeekHead) == id ? "KaxSeekHead"
: "unknown"));
} else if (is_id(l3, KaxSeekPosition)) {
@ -1822,7 +1822,7 @@ process_file(const std::string &file_name) {
EbmlStream *es = new EbmlStream(*in);
// Find the EbmlHead element. Must be the first one.
l0 = es->FindNextID(CLASS_INFO(EbmlHead), 0xFFFFFFFFL);
l0 = es->FindNextID(EBML_INFO(EbmlHead), 0xFFFFFFFFL);
if (NULL == l0) {
show_error(Y("No EBML head found."));
delete es;
@ -1836,7 +1836,7 @@ process_file(const std::string &file_name) {
while (1) {
// Next element must be a segment
l0 = es->FindNextID(CLASS_INFO(KaxSegment), 0xFFFFFFFFFFFFFFFFLL);
l0 = es->FindNextID(EBML_INFO(KaxSegment), 0xFFFFFFFFFFFFFFFFLL);
if (NULL == l0) {
show_error(Y("No segment/level 0 element found."));
return false;

View File

@ -95,7 +95,7 @@ using namespace libmatroska;
#define in_parent(p) \
(!p->IsFiniteSize() || (m_in->getFilePointer() < (p->GetElementPosition() + p->HeadSize() + p->GetSize())))
#define is_ebmlvoid(e) (EbmlId(*e) == CLASS_ID(EbmlVoid))
#define is_ebmlvoid(e) (EbmlId(*e) == EBML_ID(EbmlVoid))
#define MAGIC_MKV 0x1a45dfa3
@ -489,18 +489,18 @@ kax_reader_c::handle_attachments(mm_io_c *io,
int upper_lvl_el;
EbmlElement *l1 = m_es->FindNextElement(l0->Generic().Context, upper_lvl_el, 0xFFFFFFFFL, true);
if ((NULL != l1) && (EbmlId(*l1) == CLASS_ID(KaxAttachments))) {
if ((NULL != l1) && (EbmlId(*l1) == EBML_ID(KaxAttachments))) {
KaxAttachments *atts = (KaxAttachments *)l1;
EbmlElement *l2 = NULL;
upper_lvl_el = 0;
atts->Read(*m_es, CLASS_INFO(KaxAttachments).Context, upper_lvl_el, l2, true);
atts->Read(*m_es, EBML_INFO(KaxAttachments).Context, upper_lvl_el, l2, true);
int i;
for (i = 0; i < atts->ListSize(); i++) {
KaxAttached *att = (KaxAttached *)(*atts)[i];
if (EbmlId(*att) == CLASS_ID(KaxAttached)) {
if (EbmlId(*att) == EBML_ID(KaxAttached)) {
UTFstring name = L"";
UTFstring description = L"";
std::string mime_type = "";
@ -512,23 +512,23 @@ kax_reader_c::handle_attachments(mm_io_c *io,
for (k = 0; k < att->ListSize(); k++) {
l2 = (*att)[k];
if (EbmlId(*l2) == CLASS_ID(KaxFileName)) {
if (EbmlId(*l2) == EBML_ID(KaxFileName)) {
KaxFileName &fname = *static_cast<KaxFileName *>(l2);
name = UTFstring(fname);
} else if (EbmlId(*l2) == CLASS_ID(KaxFileDescription)) {
} else if (EbmlId(*l2) == EBML_ID(KaxFileDescription)) {
KaxFileDescription &fdesc = *static_cast<KaxFileDescription *>(l2);
description = UTFstring(fdesc);
} else if (EbmlId(*l2) == CLASS_ID(KaxMimeType)) {
} else if (EbmlId(*l2) == EBML_ID(KaxMimeType)) {
KaxMimeType &mtype = *static_cast<KaxMimeType *>(l2);
mime_type = std::string(mtype);
} else if (EbmlId(*l2) == CLASS_ID(KaxFileUID)) {
} else if (EbmlId(*l2) == EBML_ID(KaxFileUID)) {
KaxFileUID &fuid = *static_cast<KaxFileUID *>(l2);
id = uint64(fuid);
} else if (EbmlId(*l2) == CLASS_ID(KaxFileData)) {
} else if (EbmlId(*l2) == EBML_ID(KaxFileData)) {
KaxFileData &fdata = *static_cast<KaxFileData *>(l2);
size = fdata.GetSize();
data = (unsigned char *)fdata.GetBuffer();
@ -575,7 +575,7 @@ kax_reader_c::handle_chapters(mm_io_c *io,
EbmlElement *l2 = NULL;
upper_lvl_el = 0;
tmp_chapters->Read(*m_es, CLASS_INFO(KaxChapters).Context, upper_lvl_el, l2, true);
tmp_chapters->Read(*m_es, EBML_INFO(KaxChapters).Context, upper_lvl_el, l2, true);
if (NULL == m_chapters)
m_chapters = new KaxChapters;
@ -603,15 +603,15 @@ kax_reader_c::handle_tags(mm_io_c *io,
io->save_pos(pos);
EbmlElement *l1 = m_es->FindNextElement(l0->Generic().Context, upper_lvl_el, 0xFFFFFFFFL, true);
if ((NULL != l1) && (EbmlId(*l1) == CLASS_ID(KaxTags))) {
if ((NULL != l1) && (EbmlId(*l1) == EBML_ID(KaxTags))) {
KaxTags *tags = (KaxTags *)l1;
EbmlElement *l2 = NULL;
upper_lvl_el = 0;
tags->Read(*m_es, CLASS_INFO(KaxTags).Context, upper_lvl_el, l2, true);
tags->Read(*m_es, EBML_INFO(KaxTags).Context, upper_lvl_el, l2, true);
while (tags->ListSize() > 0) {
if (!(EbmlId(*(*tags)[0]) == CLASS_ID(KaxTag))) {
if (!(EbmlId(*(*tags)[0]) == EBML_ID(KaxTag))) {
delete (*tags)[0];
tags->Remove(0);
continue;
@ -674,7 +674,7 @@ kax_reader_c::read_headers_info(EbmlElement *&l1,
// General info about this Matroska file
mxverb(2, "matroska_reader: |+ segment information...\n");
l1->Read(*m_es, CLASS_INFO(KaxInfo).Context, upper_lvl_el, l2, true);
l1->Read(*m_es, EBML_INFO(KaxInfo).Context, upper_lvl_el, l2, true);
KaxTimecodeScale *ktc_scale = FINDFIRST(l1, KaxTimecodeScale);
if (NULL != ktc_scale) {
@ -906,7 +906,7 @@ kax_reader_c::read_headers_tracks(mm_io_c *io,
EbmlElement *l2 = NULL;
upper_lvl_el = 0;
l1->Read(*m_es, CLASS_INFO(KaxTracks).Context, upper_lvl_el, l2, true);
l1->Read(*m_es, EBML_INFO(KaxTracks).Context, upper_lvl_el, l2, true);
KaxTrackEntry *ktentry = FINDFIRST(l1, KaxTrackEntry);
while (ktentry != NULL) {
@ -1042,10 +1042,10 @@ kax_reader_c::read_headers_seek_head(EbmlElement *&l0,
KaxSeekHead &seek_head = *static_cast<KaxSeekHead *>(l1);
int i = 0;
seek_head.Read(*m_es, CLASS_INFO(KaxSeekHead).Context, i, el, true);
seek_head.Read(*m_es, EBML_INFO(KaxSeekHead).Context, i, el, true);
for (i = 0; i < seek_head.ListSize(); i++) {
if (EbmlId(*seek_head[i]) != CLASS_ID(KaxSeek))
if (EbmlId(*seek_head[i]) != EBML_ID(KaxSeek))
continue;
KaxSeek &seek = *static_cast<KaxSeek *>(seek_head[i]);
@ -1054,17 +1054,17 @@ kax_reader_c::read_headers_seek_head(EbmlElement *&l0,
int k;
for (k = 0; k < seek.ListSize(); k++)
if (EbmlId(*seek[k]) == CLASS_ID(KaxSeekID)) {
if (EbmlId(*seek[k]) == EBML_ID(KaxSeekID)) {
KaxSeekID &sid = *static_cast<KaxSeekID *>(seek[k]);
EbmlId id(sid.GetBuffer(), sid.GetSize());
type = id == CLASS_ID(KaxAttachments) ? dl1t_attachments
: id == CLASS_ID(KaxChapters) ? dl1t_chapters
: id == CLASS_ID(KaxTags) ? dl1t_tags
: id == CLASS_ID(KaxTracks) ? dl1t_tracks
type = id == EBML_ID(KaxAttachments) ? dl1t_attachments
: id == EBML_ID(KaxChapters) ? dl1t_chapters
: id == EBML_ID(KaxTags) ? dl1t_tags
: id == EBML_ID(KaxTracks) ? dl1t_tracks
: dl1t_unknown;
} else if (EbmlId(*seek[k]) == CLASS_ID(KaxSeekPosition))
} else if (EbmlId(*seek[k]) == EBML_ID(KaxSeekPosition))
pos = uint64(*static_cast<KaxSeekPosition *>(seek[k]));
if ((-1 != pos) && (dl1t_unknown != type)) {
@ -1086,7 +1086,7 @@ kax_reader_c::read_headers() {
m_in_file = kax_file_cptr(new kax_file_c(m_in));
// Find the EbmlHead element. Must be the first one.
EbmlElement *l0 = m_es->FindNextID(CLASS_INFO(EbmlHead), 0xFFFFFFFFFFFFFFFFLL);
EbmlElement *l0 = m_es->FindNextID(EBML_INFO(EbmlHead), 0xFFFFFFFFFFFFFFFFLL);
if (NULL == l0) {
mxwarn(Y("matroska_reader: no EBML head found.\n"));
return false;
@ -1098,13 +1098,13 @@ kax_reader_c::read_headers() {
mxverb(2, "matroska_reader: Found the head...\n");
// Next element must be a segment
l0 = m_es->FindNextID(CLASS_INFO(KaxSegment), 0xFFFFFFFFFFFFFFFFLL);
l0 = m_es->FindNextID(EBML_INFO(KaxSegment), 0xFFFFFFFFFFFFFFFFLL);
if (NULL == l0) {
if (verbose)
mxwarn(Y("matroska_reader: No segment found.\n"));
return false;
}
if (!(EbmlId(*l0) == CLASS_ID(KaxSegment))) {
if (!(EbmlId(*l0) == EBML_ID(KaxSegment))) {
if (verbose)
mxwarn(Y("matroska_reader: No segment found.\n"));
return false;
@ -1119,25 +1119,25 @@ kax_reader_c::read_headers() {
while ((NULL != l1) && (0 >= upper_lvl_el)) {
EbmlElement *l2;
if (EbmlId(*l1) == CLASS_ID(KaxInfo))
if (EbmlId(*l1) == EBML_ID(KaxInfo))
read_headers_info(l1, l2, upper_lvl_el);
else if (EbmlId(*l1) == CLASS_ID(KaxTracks))
else if (EbmlId(*l1) == EBML_ID(KaxTracks))
m_deferred_l1_positions[dl1t_tracks].push_back(l1->GetElementPosition());
else if (EbmlId(*l1) == CLASS_ID(KaxAttachments))
else if (EbmlId(*l1) == EBML_ID(KaxAttachments))
m_deferred_l1_positions[dl1t_attachments].push_back(l1->GetElementPosition());
else if (EbmlId(*l1) == CLASS_ID(KaxChapters))
else if (EbmlId(*l1) == EBML_ID(KaxChapters))
m_deferred_l1_positions[dl1t_chapters].push_back(l1->GetElementPosition());
else if (EbmlId(*l1) == CLASS_ID(KaxTags))
else if (EbmlId(*l1) == EBML_ID(KaxTags))
m_deferred_l1_positions[dl1t_tags].push_back(l1->GetElementPosition());
else if (EbmlId(*l1) == CLASS_ID(KaxSeekHead))
else if (EbmlId(*l1) == EBML_ID(KaxSeekHead))
read_headers_seek_head(l0, l1);
else if (EbmlId(*l1) == CLASS_ID(KaxCluster)) {
else if (EbmlId(*l1) == EBML_ID(KaxCluster)) {
mxverb(2, "matroska_reader: |+ found cluster, headers are parsed completely\n");
cluster = static_cast<KaxCluster *>(l1);
@ -1655,13 +1655,13 @@ kax_reader_c::read_first_frames(kax_track_t *t,
if (NULL == cluster)
return;
KaxClusterTimecode *ctc = static_cast<KaxClusterTimecode *> (cluster->FindFirstElt(CLASS_INFO(KaxClusterTimecode), false));
KaxClusterTimecode *ctc = static_cast<KaxClusterTimecode *> (cluster->FindFirstElt(EBML_INFO(KaxClusterTimecode), false));
if (NULL != ctc)
cluster->InitTimecode(uint64(*ctc), m_tc_scale);
int bgidx;
for (bgidx = 0; bgidx < cluster->ListSize(); bgidx++) {
if ((EbmlId(*(*cluster)[bgidx]) == CLASS_ID(KaxSimpleBlock))) {
if ((EbmlId(*(*cluster)[bgidx]) == EBML_ID(KaxSimpleBlock))) {
KaxSimpleBlock *block_simple = static_cast<KaxSimpleBlock *>((*cluster)[bgidx]);
block_simple->SetParent(*cluster);
@ -1682,9 +1682,9 @@ kax_reader_c::read_first_frames(kax_track_t *t,
block_track->first_frames_data.back()->grab();
}
} else if ((EbmlId(*(*cluster)[bgidx]) == CLASS_ID(KaxBlockGroup))) {
} else if ((EbmlId(*(*cluster)[bgidx]) == EBML_ID(KaxBlockGroup))) {
KaxBlockGroup *block_group = static_cast<KaxBlockGroup *>((*cluster)[bgidx]);
KaxBlock *block = static_cast<KaxBlock *>(block_group->FindFirstElt(CLASS_INFO(KaxBlock), false));
KaxBlock *block = static_cast<KaxBlock *>(block_group->FindFirstElt(EBML_INFO(KaxBlock), false));
if (NULL == block)
continue;
@ -1742,7 +1742,7 @@ kax_reader_c::read(generic_packetizer_c *requested_ptzr,
return FILE_STATUS_DONE;
}
KaxClusterTimecode *ctc = static_cast<KaxClusterTimecode *>(cluster->FindFirstElt(CLASS_INFO(KaxClusterTimecode), false));
KaxClusterTimecode *ctc = static_cast<KaxClusterTimecode *>(cluster->FindFirstElt(EBML_INFO(KaxClusterTimecode), false));
if (NULL == ctc)
mxerror(Y("r_matroska: Cluster does not contain a cluster timecode. File is broken. Aborting.\n"));
@ -1761,10 +1761,10 @@ kax_reader_c::read(generic_packetizer_c *requested_ptzr,
for (bgidx = 0; bgidx < cluster->ListSize(); bgidx++) {
EbmlElement *element = (*cluster)[bgidx];
if (EbmlId(*element) == CLASS_ID(KaxSimpleBlock))
if (EbmlId(*element) == EBML_ID(KaxSimpleBlock))
process_simple_block(cluster, static_cast<KaxSimpleBlock *>(element));
else if (EbmlId(*element) == CLASS_ID(KaxBlockGroup))
else if (EbmlId(*element) == EBML_ID(KaxBlockGroup))
process_block_group(cluster, static_cast<KaxBlockGroup *>(element));
}
@ -1877,7 +1877,7 @@ kax_reader_c::process_block_group(KaxCluster *cluster,
int64_t block_fref = VFT_NOBFRAME;
bool bref_found = false;
bool fref_found = false;
KaxReferenceBlock *ref_block = static_cast<KaxReferenceBlock *>(block_group->FindFirstElt(CLASS_INFO(KaxReferenceBlock), false));
KaxReferenceBlock *ref_block = static_cast<KaxReferenceBlock *>(block_group->FindFirstElt(EBML_INFO(KaxReferenceBlock), false));
while (NULL != ref_block) {
if (0 >= int64(*ref_block)) {
@ -1891,7 +1891,7 @@ kax_reader_c::process_block_group(KaxCluster *cluster,
ref_block = static_cast<KaxReferenceBlock *>(block_group->FindNextElt(*ref_block, false));
}
KaxBlock *block = static_cast<KaxBlock *>(block_group->FindFirstElt(CLASS_INFO(KaxBlock), false));
KaxBlock *block = static_cast<KaxBlock *>(block_group->FindFirstElt(EBML_INFO(KaxBlock), false));
if (NULL == block) {
mxwarn_fn(m_ti.m_fname,
boost::format(Y("A block group was found at position %1%, but no block element was found inside it. This might make mkvmerge crash.\n"))
@ -1909,8 +1909,8 @@ kax_reader_c::process_block_group(KaxCluster *cluster,
return;
}
KaxBlockAdditions *blockadd = static_cast<KaxBlockAdditions *>(block_group->FindFirstElt(CLASS_INFO(KaxBlockAdditions), false));
KaxBlockDuration *duration = static_cast<KaxBlockDuration *>(block_group->FindFirstElt(CLASS_INFO(KaxBlockDuration), false));
KaxBlockAdditions *blockadd = static_cast<KaxBlockAdditions *>(block_group->FindFirstElt(EBML_INFO(KaxBlockAdditions), false));
KaxBlockDuration *duration = static_cast<KaxBlockDuration *>(block_group->FindFirstElt(EBML_INFO(KaxBlockDuration), false));
if (NULL != duration)
block_duration = (int64_t)uint64(*duration) * m_tc_scale / block->NumberFrames();
@ -1933,7 +1933,7 @@ kax_reader_c::process_block_group(KaxCluster *cluster,
if (m_appending)
m_last_timecode -= m_first_timecode;
KaxCodecState *codec_state = static_cast<KaxCodecState *>(block_group->FindFirstElt(CLASS_INFO(KaxCodecState)));
KaxCodecState *codec_state = static_cast<KaxCodecState *>(block_group->FindFirstElt(EBML_INFO(KaxCodecState)));
if ((NULL != codec_state) && !hack_engaged(ENGAGE_USE_CODEC_STATE))
mxerror_tid(m_ti.m_fname, block_track->tnum,
Y("This track uses a Matroska feature called 'Codec state elements'. mkvmerge supports these but "

View File

@ -1348,7 +1348,7 @@ finish_file(bool last_file) {
} else if (!last_file && g_no_linking) {
int i;
for (i = 0; s_kax_infos->ListSize() > i; ++i)
if (EbmlId(*(*s_kax_infos)[i]) == CLASS_ID(KaxNextUID)) {
if (EbmlId(*(*s_kax_infos)[i]) == EBML_ID(KaxNextUID)) {
delete (*s_kax_infos)[i];
s_kax_infos->Remove(i);
changed = 2;