Further fixes to WS/MP4 (implemented "auto" track, implemented dropping video voluntarily)
This commit is contained in:
parent
a1ffc383cb
commit
1e6143bc88
1 changed files with 7 additions and 3 deletions
|
@ -1506,14 +1506,14 @@ namespace Mist{
|
||||||
webSock->sendFrame("{\"type\":\"pause\",\"paused\":true}");
|
webSock->sendFrame("{\"type\":\"pause\",\"paused\":true}");
|
||||||
}else if (command["type"] == "tracks") {
|
}else if (command["type"] == "tracks") {
|
||||||
if (command.isMember("audio")){
|
if (command.isMember("audio")){
|
||||||
if (!command["audio"].isNull()){
|
if (!command["audio"].isNull() && command["audio"] != "auto"){
|
||||||
targetParams["audio"] = command["audio"].asString();
|
targetParams["audio"] = command["audio"].asString();
|
||||||
}else{
|
}else{
|
||||||
targetParams.erase("audio");
|
targetParams.erase("audio");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (command.isMember("video")){
|
if (command.isMember("video")){
|
||||||
if (!command["video"].isNull()){
|
if (!command["video"].isNull() && command["video"] != "auto"){
|
||||||
targetParams["video"] = command["video"].asString();
|
targetParams["video"] = command["video"].asString();
|
||||||
}else{
|
}else{
|
||||||
targetParams.erase("video");
|
targetParams.erase("video");
|
||||||
|
@ -1552,8 +1552,12 @@ namespace Mist{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (seekTarget != currentTime()){prevVidTrack = INVALID_TRACK_ID;}
|
if (seekTarget != currentTime()){prevVidTrack = INVALID_TRACK_ID;}
|
||||||
|
bool hasVideo = false;
|
||||||
|
for (std::map<size_t, Comms::Users>::iterator it = userSelect.begin(); it != userSelect.end(); it++){
|
||||||
|
if (M.getType(it->first) == "video"){hasVideo = true;}
|
||||||
|
}
|
||||||
// Add the previous video track back, if we had one.
|
// Add the previous video track back, if we had one.
|
||||||
if (prevVidTrack != INVALID_TRACK_ID && !userSelect.count(prevVidTrack)){
|
if (prevVidTrack != INVALID_TRACK_ID && !userSelect.count(prevVidTrack) && hasVideo){
|
||||||
userSelect[prevVidTrack].reload(streamName, prevVidTrack);
|
userSelect[prevVidTrack].reload(streamName, prevVidTrack);
|
||||||
seek(seekTarget);
|
seek(seekTarget);
|
||||||
std::set<size_t> newSelTracks;
|
std::set<size_t> newSelTracks;
|
||||||
|
|
Loading…
Add table
Reference in a new issue