RTMP track re-selection timer added.

This commit is contained in:
Thulinma 2016-06-07 15:20:44 +02:00
parent 7c46f008a8
commit 3c41142a57

View file

@ -271,15 +271,22 @@ namespace Mist {
//If there are now more selectable tracks, select the new track and do a seek to the current timestamp //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 //Set sentHeader to false to force it to send init data
if (selectedTracks.size() < 2 && myMeta.tracks.size() > 1){ if (selectedTracks.size() < 2){
size_t prevTrackCount = selectedTracks.size(); static unsigned long long lastMeta = 0;
selectDefaultTracks(); if (Util::epoch() > lastMeta + 5){
if (selectedTracks.size() > prevTrackCount){ lastMeta = Util::epoch();
INFO_MSG("Picked up new track - selecting it and resetting state."); updateMeta();
sentHeader = false; if (myMeta.tracks.size() > 1){
seek(thisPacket.getTime()); 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;
}
}
} }
return;
} }