Added Track::finalize call to finish (live) tracks and record their complete duration, by Oswald de Bruin.

This commit is contained in:
Thulinma 2015-09-03 20:15:10 +02:00
parent 096b289cdf
commit b0b4a5d10d
2 changed files with 5 additions and 0 deletions

View file

@ -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();

View file

@ -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;