Added Track::finalize call to finish (live) tracks and record their complete duration, by Oswald de Bruin.
This commit is contained in:
parent
096b289cdf
commit
b0b4a5d10d
2 changed files with 5 additions and 0 deletions
|
@ -275,6 +275,7 @@ namespace DTSC {
|
||||||
unsigned int timeToFragnum(unsigned int timestamp);
|
unsigned int timeToFragnum(unsigned int timestamp);
|
||||||
void reset();
|
void reset();
|
||||||
void toPrettyString(std::ostream & str, int indent = 0, int verbosity = 0);
|
void toPrettyString(std::ostream & str, int indent = 0, int verbosity = 0);
|
||||||
|
void finalize();
|
||||||
|
|
||||||
std::string getIdentifier();
|
std::string getIdentifier();
|
||||||
std::string getWritableIdentifier();
|
std::string getWritableIdentifier();
|
||||||
|
|
|
@ -1114,6 +1114,10 @@ namespace DTSC {
|
||||||
fragments.rbegin()->setSize(fragments.rbegin()->getSize() + packDataSize);
|
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
|
///\brief Returns a key given its number, or an empty key if the number is out of bounds
|
||||||
Key & Track::getKey(unsigned int keyNum) {
|
Key & Track::getKey(unsigned int keyNum) {
|
||||||
static Key empty;
|
static Key empty;
|
||||||
|
|
Loading…
Add table
Reference in a new issue