diff --git a/src/output/output.cpp b/src/output/output.cpp index d34f4283..afe4aded 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -466,6 +466,20 @@ namespace Mist { return buffer.begin()->time; } + ///Return the end time of the VoD asset, or 0 if unknown. + uint64_t Output::endTime(){ + if (myMeta.live){return 0;} + uint64_t end = 0; + for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ + if (myMeta.tracks.count(*it)){ + if (end < myMeta.tracks[*it].lastms){ + end = myMeta.tracks[*it].lastms; + } + } + } + return end; + } + /// Prepares all tracks from selectedTracks for seeking to the specified ms position. void Output::seek(unsigned long long pos){ sought = true; diff --git a/src/output/output.h b/src/output/output.h index d7ba6e2e..718856a7 100644 --- a/src/output/output.h +++ b/src/output/output.h @@ -47,6 +47,7 @@ namespace Mist { bool seek(unsigned int tid, unsigned long long pos, bool getNextKey = false); void stop(); uint64_t currentTime(); + uint64_t endTime(); void setBlocking(bool blocking); long unsigned int getMainSelectedTrack(); void updateMeta();