Improved handling of later-added tracks

This commit is contained in:
Thulinma 2020-06-21 14:03:19 +02:00
parent cbe4f017f3
commit a9bc4e2134
2 changed files with 9 additions and 14 deletions

View file

@ -106,20 +106,14 @@ 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 // If selectable tracks changed, set sentHeader to false to force it to send init data
// timestamp Set sentHeader to false to force it to send init data static uint64_t lastMeta = 0;
if (userSelect.size() < 2){ if (Util::epoch() > lastMeta + 5){
static uint64_t lastMeta = 0; lastMeta = Util::epoch();
if (Util::epoch() > lastMeta + 5){ if (selectDefaultTracks()){
lastMeta = Util::epoch(); INFO_MSG("Track selection changed - resending headers and continuing");
std::set<size_t> validTracks = getSupportedTracks(); sentHeader = false;
if (validTracks.size() > 1){ return;
if (selectDefaultTracks()){
INFO_MSG("Track selection changed - resending headers and continuing");
sentHeader = false;
return;
}
}
} }
} }
DTSC::Packet p(thisPacket, thisIdx + 1); DTSC::Packet p(thisPacket, thisIdx + 1);

View file

@ -1039,6 +1039,7 @@ namespace Mist{
newState = streamStatus.mapped[0]; newState = streamStatus.mapped[0];
} }
if (meta){meta.refresh();}
if (newState != prevState || (newState == STRMSTAT_READY && M.getValidTracks() != prevTracks)){ if (newState != prevState || (newState == STRMSTAT_READY && M.getValidTracks() != prevTracks)){
if (newState == STRMSTAT_READY){ if (newState == STRMSTAT_READY){
reconnect(); reconnect();