diff --git a/src/input/input.cpp b/src/input/input.cpp index 339033ce..e192f599 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -552,6 +552,12 @@ namespace Mist { } return; } + + char userPageName[NAME_BUFFER_SIZE]; + snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str()); + nProxy.userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true); + nProxy.userClient.countAsViewer = false; + parseStreamHeader(); if (myMeta.tracks.size() == 0){ @@ -566,11 +572,6 @@ namespace Mist { return; } - char userPageName[NAME_BUFFER_SIZE]; - snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str()); - nProxy.userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true); - nProxy.userClient.countAsViewer = false; - for (std::map::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++){ it->second.firstms = 0; it->second.lastms = 0; diff --git a/src/output/output_http.cpp b/src/output/output_http.cpp index a3ad5190..91f77d21 100644 --- a/src/output/output_http.cpp +++ b/src/output/output_http.cpp @@ -42,9 +42,11 @@ namespace Mist { } void HTTPOutput::onFail(){ - H.Clean(); //make sure no parts of old requests are left in any buffers - H.SetBody("Stream not found. Sorry, we tried."); - H.SendResponse("404", "Stream not found", myConn); + if (!webSock){ + H.Clean(); //make sure no parts of old requests are left in any buffers + H.SetBody("Stream not found. Sorry, we tried."); + H.SendResponse("404", "Stream not found", myConn); + } Output::onFail(); }