mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-08 11:11:51 +00:00
Helper function for writing an EBML element's head (ID + size fields)
This commit is contained in:
parent
6a187a8702
commit
52710b5bea
@ -515,3 +515,17 @@ remove_voids_from_master(EbmlElement *element) {
|
||||
if (master)
|
||||
DeleteChildren<EbmlVoid>(master);
|
||||
}
|
||||
|
||||
int
|
||||
write_ebml_element_head(mm_io_c &out,
|
||||
EbmlId const &id,
|
||||
int64_t content_size) {
|
||||
int id_size = EBML_ID_LENGTH(id);
|
||||
int coded_size = CodedSizeLength(content_size, 0);
|
||||
uint8_t buffer[4 + 8];
|
||||
|
||||
id.Fill(buffer);
|
||||
CodedValueLength(content_size, coded_size, &buffer[id_size]);
|
||||
|
||||
return out.write(buffer, id_size + coded_size);
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ int kt_get_a_bps(KaxTrackEntry &track);
|
||||
int kt_get_v_pixel_width(KaxTrackEntry &track);
|
||||
int kt_get_v_pixel_height(KaxTrackEntry &track);
|
||||
|
||||
int write_ebml_element_head(mm_io_c &out, EbmlId const &id, int64_t content_size);
|
||||
|
||||
#define is_id(e, ref) (EbmlId(*e) == EBML_ID(ref))
|
||||
#if !defined(EBML_INFO)
|
||||
#define EBML_INFO(ref) ref::ClassInfos
|
||||
|
Loading…
Reference in New Issue
Block a user