diff --git a/src/output/output.cpp b/src/output/output.cpp index 1ba2c414..b292331d 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -552,6 +552,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 128e5696..0e2f8589 100644 --- a/src/output/output.h +++ b/src/output/output.h @@ -59,6 +59,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();