summaryrefslogtreecommitdiff
path: root/src/h__02_Writer.cpp
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2020-10-08 09:31:16 -0700
committerjhurst <jhurst@cinecert.com>2020-10-08 09:31:16 -0700
commitf8b52f9e183b3d20e050a8760f5e8caed35b2e9d (patch)
treecc9b459d6b4218541ec2be06472642a970e7f919 /src/h__02_Writer.cpp
parent25416a414301ddf79f499373c279740a519a27b1 (diff)
parentd417531ed59434ecaee487adfdf54646408479bf (diff)
Merge branch 'master' into sha1_builtin
Diffstat (limited to 'src/h__02_Writer.cpp')
-rw-r--r--src/h__02_Writer.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/h__02_Writer.cpp b/src/h__02_Writer.cpp
index 9b1c6c6..d7cfaa3 100644
--- a/src/h__02_Writer.cpp
+++ b/src/h__02_Writer.cpp
@@ -161,7 +161,17 @@ AS_02::MXF::AS02IndexWriterVBR::PushIndexEntry(const IndexTableSegment::IndexEnt
m_CurrentSegment->DeltaEntryArray.push_back(IndexTableSegment::DeltaEntry());
m_CurrentSegment->IndexEditRate = m_EditRate;
m_CurrentSegment->IndexStartPosition = 0;
- }
+ } else if (m_CurrentSegment->IndexEntryArray.size() >= CBRIndexEntriesPerSegment) { // no, this one is full, start another
+ m_CurrentSegment->IndexDuration = m_CurrentSegment->IndexEntryArray.size();
+ ui64_t StartPosition = m_CurrentSegment->IndexStartPosition + m_CurrentSegment->IndexDuration;
+
+ m_CurrentSegment = new IndexTableSegment(m_Dict);
+ assert(m_CurrentSegment);
+ AddChildObject(m_CurrentSegment);
+ m_CurrentSegment->DeltaEntryArray.push_back(IndexTableSegment::DeltaEntry());
+ m_CurrentSegment->IndexEditRate = m_EditRate;
+ m_CurrentSegment->IndexStartPosition = StartPosition;
+ }
m_CurrentSegment->IndexEntryArray.push_back(Entry);
}