Added/improved start/endTime functions in Output class
This commit is contained in:
parent
1aeecc53bd
commit
63ea74d792
2 changed files with 23 additions and 5 deletions
|
@ -466,14 +466,31 @@ namespace Mist {
|
||||||
return buffer.begin()->time;
|
return buffer.begin()->time;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Return the end time of the VoD asset, or 0 if unknown.
|
///Return the start time of the selected tracks.
|
||||||
|
uint64_t Output::startTime(){
|
||||||
|
uint64_t start = 0xFFFFFFFFFFFFFFFFull;
|
||||||
|
if (selectedTracks.size()){
|
||||||
|
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
|
||||||
|
if (myMeta.tracks.count(*it)){
|
||||||
|
if (start < myMeta.tracks[*it].firstms){
|
||||||
|
start = myMeta.tracks[*it].firstms;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return start;
|
||||||
|
}
|
||||||
|
|
||||||
|
///Return the end time of the selected tracks, or 0 if unknown or live.
|
||||||
uint64_t Output::endTime(){
|
uint64_t Output::endTime(){
|
||||||
if (myMeta.live){return 0;}
|
if (myMeta.live){return 0;}
|
||||||
uint64_t end = 0;
|
uint64_t end = 0;
|
||||||
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
|
if (selectedTracks.size()){
|
||||||
if (myMeta.tracks.count(*it)){
|
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
|
||||||
if (end < myMeta.tracks[*it].lastms){
|
if (myMeta.tracks.count(*it)){
|
||||||
end = myMeta.tracks[*it].lastms;
|
if (end < myMeta.tracks[*it].lastms){
|
||||||
|
end = myMeta.tracks[*it].lastms;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace Mist {
|
||||||
bool seek(unsigned int tid, unsigned long long pos, bool getNextKey = false);
|
bool seek(unsigned int tid, unsigned long long pos, bool getNextKey = false);
|
||||||
void stop();
|
void stop();
|
||||||
uint64_t currentTime();
|
uint64_t currentTime();
|
||||||
|
uint64_t startTime();
|
||||||
uint64_t endTime();
|
uint64_t endTime();
|
||||||
void setBlocking(bool blocking);
|
void setBlocking(bool blocking);
|
||||||
long unsigned int getMainSelectedTrack();
|
long unsigned int getMainSelectedTrack();
|
||||||
|
|
Loading…
Add table
Reference in a new issue