Skip to content

Commit

Permalink
Merge remote-tracking branch 'robux4/private_head'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbunkus committed Feb 24, 2024
2 parents 99c3f1b + 42ae016 commit e415b3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 8 additions & 4 deletions ebml/EbmlElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@ class EBML_DLL_API EbmlElement {
return ElementPosition;
}

std::uint64_t GetDataStart() const {
return GetElementPosition() + HeadSize();
}

std::uint64_t ElementSize(const ShouldWrite& writeFilter = WriteSkipDefault) const; /// return the size of the header+data, before writing

filepos_t Render(IOCallback & output, const ShouldWrite& writeFilter = WriteSkipDefault, bool bKeepPosition = false, bool bForceRender = false);
Expand All @@ -529,10 +533,6 @@ class EBML_DLL_API EbmlElement {
virtual bool IsDummy() const {return false;}
virtual bool IsMaster() const {return false;}

std::size_t HeadSize() const {
return EBML_ID_LENGTH((const EbmlId&)*this) + CodedSizeLength(Size, SizeLength, bSizeIsFinite);
} /// return the size of the head, on reading/writing

/*!
\brief Force the size of an element
\warning only possible if the size is "undefined"
Expand Down Expand Up @@ -597,6 +597,10 @@ class EBML_DLL_API EbmlElement {
const EbmlCallbacks & ClassInfo;

private:
std::size_t HeadSize() const {
return EBML_ID_LENGTH((const EbmlId&)*this) + CodedSizeLength(Size, SizeLength, bSizeIsFinite);
} /// return the size of the head, on reading/writing

std::uint64_t Size; ///< the size of the data to write
std::uint64_t DefaultSize; ///< Minimum data size to fill on rendering (0 = optimal)
unsigned int SizeLength{0}; /// the minimum size on which the size will be written (0 = optimal)
Expand Down
4 changes: 0 additions & 4 deletions ebml/EbmlMaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ class EBML_DLL_API EbmlMaster : public EbmlElement {
return (0-1);
}

std::uint64_t GetDataStart() const {
return GetElementPosition() + HeadSize();
}

/*!
\brief find the element corresponding to the ID of the element, NULL if not found
*/
Expand Down

0 comments on commit e415b3c

Please sign in to comment.