diff --git a/src/output/output.cpp b/src/output/output.cpp index bf93e9d1..e660db78 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -487,6 +487,14 @@ namespace Mist { statsPage.keepAlive(); } int tNum = 0; + if (!playerConn.getData()){ + playerConn = IPC::sharedClient(streamName + "_users", 30, true); + if (!playerConn.getData()){ + DEBUG_MSG(DLVL_WARN, "Player connection failure - aborting output"); + myConn.close(); + return; + } + } for (std::set::iterator it = selectedTracks.begin(); it != selectedTracks.end() && tNum < 5; it++){ char thisData[6]; thisData[0] = ((*it >> 24) & 0xFF); diff --git a/src/output/output_rtmp.cpp b/src/output/output_rtmp.cpp index 54ba23c6..5dec2a71 100644 --- a/src/output/output_rtmp.cpp +++ b/src/output/output_rtmp.cpp @@ -7,10 +7,9 @@ namespace Mist { OutRTMP::OutRTMP(Socket::Connection & conn) : Output(conn) { - setBlocking(false); + setBlocking(true); while (!conn.Received().available(1537) && conn.connected()) { conn.spool(); - Util::sleep(5); } if (!conn){ return; @@ -22,7 +21,6 @@ namespace Mist { conn.SendNow(RTMPStream::handshake_out); while (!conn.Received().available(1536) && conn.connected()) { conn.spool(); - Util::sleep(5); } conn.Received().remove(1536); RTMPStream::rec_cnt += 1536; @@ -30,6 +28,7 @@ namespace Mist { } else { DEBUG_MSG(DLVL_DEVEL, "Handshake fail!"); } + setBlocking(false); counter = 0; sending = false; streamReset = false;