Skip to content

Commit

Permalink
test6: don't read compute the head size again
Browse files Browse the repository at this point in the history
It's always going to be 4+5, ie the minimum set in this case.
  • Loading branch information
robUx4 committed Feb 18, 2024
1 parent 95fa47a commit 3c6bbc0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/mux/test6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int main(int /*argc*/, char **/*argv*/)
KaxSegment FileSegment;

// size is unknown and will always be, we can render it right away
std::uint64_t SegmentSize = FileSegment.WriteHead(out_file, 5, bWriteDefaultValues);
FileSegment.WriteHead(out_file, 5, bWriteDefaultValues);

KaxTracks & MyTracks = GetChild<KaxTracks>(FileSegment);

Expand Down Expand Up @@ -335,8 +335,7 @@ int main(int /*argc*/, char **/*argv*/)
#endif // VOID_TEST

// let's assume we know the size of the Segment element
// the size of the FileSegment is also computed because mandatory elements we don't write ourself exist
if (FileSegment.ForceSize(SegmentSize - FileSegment.HeadSize() + MetaSeekSize
if (FileSegment.ForceSize(MetaSeekSize
+ TrackSize + ClusterSize + CueSize + InfoSize + TagsSize + ChapterSize)) {
FileSegment.OverwriteHead(out_file);
}
Expand Down

0 comments on commit 3c6bbc0

Please sign in to comment.