diff --git a/src/output/output_mp4.cpp b/src/output/output_mp4.cpp index 822aa81b..3f8a0611 100644 --- a/src/output/output_mp4.cpp +++ b/src/output/output_mp4.cpp @@ -1506,14 +1506,14 @@ namespace Mist{ webSock->sendFrame("{\"type\":\"pause\",\"paused\":true}"); }else if (command["type"] == "tracks") { if (command.isMember("audio")){ - if (!command["audio"].isNull()){ + if (!command["audio"].isNull() && command["audio"] != "auto"){ targetParams["audio"] = command["audio"].asString(); }else{ targetParams.erase("audio"); } } if (command.isMember("video")){ - if (!command["video"].isNull()){ + if (!command["video"].isNull() && command["video"] != "auto"){ targetParams["video"] = command["video"].asString(); }else{ targetParams.erase("video"); @@ -1552,8 +1552,12 @@ namespace Mist{ return false; } if (seekTarget != currentTime()){prevVidTrack = INVALID_TRACK_ID;} + bool hasVideo = false; + for (std::map::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. - if (prevVidTrack != INVALID_TRACK_ID && !userSelect.count(prevVidTrack)){ + if (prevVidTrack != INVALID_TRACK_ID && !userSelect.count(prevVidTrack) && hasVideo){ userSelect[prevVidTrack].reload(streamName, prevVidTrack); seek(seekTarget); std::set newSelTracks;