diff --git a/src/io.cpp b/src/io.cpp index 841d9dc3..ebf48ff6 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -29,6 +29,20 @@ namespace Mist { } + /// Returns the ID of the main selected track, or 0 if no tracks are selected. + /// The main track is the first video track, if any, and otherwise the first other track. + long unsigned int InOutBase::getMainSelectedTrack(){ + if (!selectedTracks.size()){ + return 0; + } + for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ + if (myMeta.tracks.count(*it) && myMeta.tracks[*it].type == "video"){ + return *it; + } + } + return *(selectedTracks.begin()); + } + void negotiationProxy::clear(){ pagesByTrack.clear(); trackOffset.clear(); diff --git a/src/io.h b/src/io.h index c95e4d90..a04d4f3a 100644 --- a/src/io.h +++ b/src/io.h @@ -70,6 +70,7 @@ namespace Mist { void bufferFinalize(unsigned long tid); void bufferRemove(unsigned long tid, unsigned long pageNumber); virtual void bufferLivePacket(const DTSC::Packet & packet); + long unsigned int getMainSelectedTrack(); protected: void continueNegotiate(unsigned long tid, bool quickNegotiate = false); void continueNegotiate(); diff --git a/src/output/output.cpp b/src/output/output.cpp index 4802da44..f79cffce 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -771,20 +771,6 @@ namespace Mist{ return 0; } - /// Returns the ID of the main selected track, or 0 if no tracks are selected. - /// The main track is the first video track, if any, and otherwise the first other track. - long unsigned int Output::getMainSelectedTrack(){ - if (!selectedTracks.size()){ - return 0; - } - for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ - if (myMeta.tracks.count(*it) && myMeta.tracks[*it].type == "video"){ - return *it; - } - } - return *(selectedTracks.begin()); - } - void Output::dropTrack(uint32_t trackId, std::string reason, bool probablyBad){ //depending on whether this is probably bad and the current debug level, print a message unsigned int printLevel = DLVL_INFO; diff --git a/src/output/output.h b/src/output/output.h index be875da4..1f3a536e 100644 --- a/src/output/output.h +++ b/src/output/output.h @@ -50,7 +50,6 @@ namespace Mist { uint64_t startTime(); uint64_t endTime(); void setBlocking(bool blocking); - long unsigned int getMainSelectedTrack(); void updateMeta(); void selectDefaultTracks(); bool connectToFile(std::string file);