diff --git a/sunshine/platform/windows_wasapi.cpp b/sunshine/platform/windows_wasapi.cpp index a55d1c05..97412106 100644 --- a/sunshine/platform/windows_wasapi.cpp +++ b/sunshine/platform/windows_wasapi.cpp @@ -172,7 +172,7 @@ public: REFERENCE_TIME default_latency; audio_client->GetDevicePeriod(&default_latency, nullptr); - default_latency_ms = default_latency / 10; + default_latency_ms = default_latency / 1000; status = audio_client->Initialize( AUDCLNT_SHAREMODE_SHARED, @@ -249,7 +249,6 @@ private: case WAIT_OBJECT_0: break; case WAIT_TIMEOUT: - std::fill_n(std::begin(sample_buf), sample_buf.size(), 0); return capture_e::timeout; default: BOOST_LOG(error) << "Couldn't wait for audio event: [0x"sv << util::hex(status).to_string_view() << ']'; @@ -340,4 +339,4 @@ std::unique_ptr microphone(std::uint32_t sample_rate) { std::unique_ptr init() { return std::make_unique(); } -} \ No newline at end of file +} diff --git a/sunshine/stream.cpp b/sunshine/stream.cpp index f4d74245..7f8e96d0 100644 --- a/sunshine/stream.cpp +++ b/sunshine/stream.cpp @@ -539,6 +539,8 @@ void recvThread(broadcast_ctx_t &ctx) { auto recv_func_init = [&](udp::socket &sock, int buf_elem, std::map &peer_to_session) { recv_func[buf_elem] = [&,buf_elem](const boost::system::error_code &ec, size_t bytes) { auto type_str = buf_elem ? "AUDIO"sv : "VIDEO"sv; + BOOST_LOG(debug) << "Recv: "sv << peer.address().to_string() << ":"sv << peer.port() << " :: " << type_str; + populate_peer_to_session(); @@ -841,6 +843,7 @@ void join(session_t &session) { session.videoThread.join(); BOOST_LOG(debug) << "Waiting for audio to end..."sv; session.audioThread.join(); + BOOST_LG(debug) << "Session ended"sv; } void start(session_t &session, const std::string &addr_string) {