Merge branch 'development' into LTS_development

# Conflicts:
#	src/output/output.cpp
This commit is contained in:
Thulinma 2018-08-30 13:53:21 +02:00
commit c392e3f6f9
3 changed files with 16 additions and 8 deletions

View file

@ -503,7 +503,7 @@ namespace Mist{
continue; continue;
} }
//autoSeeking and target not in bounds? Drop it too. //autoSeeking and target not in bounds? Drop it too.
if (autoSeek && myMeta.tracks[*it].lastms < seekTarget - 6000){ if (autoSeek && myMeta.tracks[*it].lastms < std::max(seekTarget, 6000lu) - 6000){
toRemove.insert(*it); toRemove.insert(*it);
} }
} }
@ -584,7 +584,7 @@ namespace Mist{
if (myMeta.live){ if (myMeta.live){
for (std::map<unsigned int, DTSC::Track>::reverse_iterator trit = myMeta.tracks.rbegin(); trit != myMeta.tracks.rend(); trit++){ for (std::map<unsigned int, DTSC::Track>::reverse_iterator trit = myMeta.tracks.rbegin(); trit != myMeta.tracks.rend(); trit++){
if ((!byType && trit->second.codec == strRef.substr(shift)) || (byType && trit->second.type == strRef.substr(shift)) || strRef.substr(shift) == "*"){ if ((!byType && trit->second.codec == strRef.substr(shift)) || (byType && trit->second.type == strRef.substr(shift)) || strRef.substr(shift) == "*"){
if (autoSeek && trit->second.lastms < seekTarget - 6000){continue;} if (autoSeek && trit->second.lastms < std::max(seekTarget, 6000lu) - 6000){continue;}
/*LTS-START*/ /*LTS-START*/
if (noSelAudio && trit->second.type == "audio"){continue;} if (noSelAudio && trit->second.type == "audio"){continue;}
if (noSelVideo && trit->second.type == "video"){continue;} if (noSelVideo && trit->second.type == "video"){continue;}
@ -598,7 +598,7 @@ namespace Mist{
}else{ }else{
for (std::map<unsigned int, DTSC::Track>::iterator trit = myMeta.tracks.begin(); trit != myMeta.tracks.end(); trit++){ for (std::map<unsigned int, DTSC::Track>::iterator trit = myMeta.tracks.begin(); trit != myMeta.tracks.end(); trit++){
if ((!byType && trit->second.codec == strRef.substr(shift)) || (byType && trit->second.type == strRef.substr(shift)) || strRef.substr(shift) == "*"){ if ((!byType && trit->second.codec == strRef.substr(shift)) || (byType && trit->second.type == strRef.substr(shift)) || strRef.substr(shift) == "*"){
if (autoSeek && trit->second.lastms < seekTarget - 6000){continue;} if (autoSeek && trit->second.lastms < std::max(seekTarget, 6000lu) - 6000){continue;}
/*LTS-START*/ /*LTS-START*/
if (noSelAudio && trit->second.type == "audio"){continue;} if (noSelAudio && trit->second.type == "audio"){continue;}
if (noSelVideo && trit->second.type == "video"){continue;} if (noSelVideo && trit->second.type == "video"){continue;}
@ -645,6 +645,7 @@ namespace Mist{
void Output::stop(){ void Output::stop(){
buffer.clear(); buffer.clear();
parseData = false; parseData = false;
sought = false;
} }
unsigned int Output::getKeyForTime(long unsigned int trackId, long long timeStamp){ unsigned int Output::getKeyForTime(long unsigned int trackId, long long timeStamp){

View file

@ -268,6 +268,7 @@ namespace Mist {
//Handle upgrade to websocket if the output supports it //Handle upgrade to websocket if the output supports it
if (doesWebsockets() && H.GetHeader("Upgrade") == "websocket"){ if (doesWebsockets() && H.GetHeader("Upgrade") == "websocket"){
INFO_MSG("Switching to Websocket mode"); INFO_MSG("Switching to Websocket mode");
setBlocking(false);
preWebsocketConnect(); preWebsocketConnect();
webSock = new HTTP::Websocket(myConn, H); webSock = new HTTP::Websocket(myConn, H);
if (!(*webSock)){ if (!(*webSock)){

View file

@ -94,24 +94,30 @@ namespace Mist {
static bool recursive = false; static bool recursive = false;
if (recursive){return true;} if (recursive){return true;}
recursive = true; recursive = true;
if (keepReselecting && !isPushing()){ if (keepReselecting && !isPushing() && !myMeta.vod){
uint64_t maxTimer = 7200; uint64_t maxTimer = 7200;
while (--maxTimer && nProxy.userClient.isAlive() && keepGoing()){ while (--maxTimer && keepGoing()){
if (!isBlocking){myConn.spool();}
Util::wait(500); Util::wait(500);
stats(); stats();
if (Util::getStreamStatus(streamName) != STRMSTAT_READY){ if (Util::getStreamStatus(streamName) != STRMSTAT_READY){
disconnect(); if (isInitialized){
INFO_MSG("Disconnecting from offline stream");
disconnect();
stop();
}
}else{ }else{
updateMeta();
if (isReadyForPlay()){ if (isReadyForPlay()){
INFO_MSG("Resuming playback!");
recursive = false; recursive = false;
parseData = true;
return true; return true;
} }
} }
} }
recursive = false; recursive = false;
} }
if (!jsonp.size() && !first){ if (!webSock && !jsonp.size() && !first){
myConn.SendNow("]\n", 2); myConn.SendNow("]\n", 2);
} }
myConn.close(); myConn.close();