diff --git a/lib/dtsc.h b/lib/dtsc.h index 4326c588..7f617a22 100644 --- a/lib/dtsc.h +++ b/lib/dtsc.h @@ -275,6 +275,7 @@ namespace DTSC { unsigned int timeToFragnum(unsigned int timestamp); void reset(); void toPrettyString(std::ostream & str, int indent = 0, int verbosity = 0); + void finalize(); std::string getIdentifier(); std::string getWritableIdentifier(); diff --git a/lib/dtscmeta.cpp b/lib/dtscmeta.cpp index e1f62386..45c3815a 100644 --- a/lib/dtscmeta.cpp +++ b/lib/dtscmeta.cpp @@ -1114,6 +1114,10 @@ namespace DTSC { fragments.rbegin()->setSize(fragments.rbegin()->getSize() + packDataSize); } + void Track::finalize(){ + keys.rbegin()->setLength(lastms - keys.rbegin()->getTime() + parts.rbegin()->getDuration()); + } + ///\brief Returns a key given its number, or an empty key if the number is out of bounds Key & Track::getKey(unsigned int keyNum) { static Key empty;