summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hurst <jhurst@cinecert.com>2020-09-08 15:56:33 -0700
committerGitHub <noreply@github.com>2020-09-08 15:56:33 -0700
commit4f8a3d9d01fb3fbca378e6cc776a2b1ea942a6e3 (patch)
treedbe472e0b1558fb52fc9adf3ae30e4c1032d33ed /src
parenta4821b725f76f1272f96770560c10a20f6462298 (diff)
parent5842f367d39b9564b29e9127373c9156f57a7ca9 (diff)
Merge pull request #53 from sandflow/issues/0052-as02-large-index-tables
Add support for multi-segment index tables to AS_02
Diffstat (limited to 'src')
-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);
}