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

View file

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