Added track-reselection to DTSC output

This commit is contained in:
Thulinma 2016-07-21 17:39:20 +02:00
parent 09b398f36c
commit 0c16ae5a80

View file

@ -52,6 +52,25 @@ namespace Mist {
} }
void OutDTSC::sendNext(){ void OutDTSC::sendNext(){
//If there are now more selectable tracks, select the new track and do a seek to the current timestamp
//Set sentHeader to false to force it to send init data
if (selectedTracks.size() < 2){
static unsigned long long lastMeta = 0;
if (Util::epoch() > lastMeta + 5){
lastMeta = Util::epoch();
updateMeta();
if (myMeta.tracks.size() > 1){
size_t prevTrackCount = selectedTracks.size();
selectDefaultTracks();
if (selectedTracks.size() > prevTrackCount){
INFO_MSG("Picked up new track - selecting it and resetting state.");
sentHeader = false;
initialSeek();
return;
}
}
}
}
myConn.SendNow(thisPacket.getData(), thisPacket.getDataLen()); myConn.SendNow(thisPacket.getData(), thisPacket.getDataLen());
} }