From f21c6b9057b59c73dd49adb442b52c4444199343 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Mon, 25 Nov 2024 16:16:07 +0000 Subject: [PATCH] audio works if user joins 2nd --- src/dpp/voice/enabled/handle_frame.cpp | 6 +++--- src/dpp/voice/enabled/read_write.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dpp/voice/enabled/handle_frame.cpp b/src/dpp/voice/enabled/handle_frame.cpp index 4521f7a375..6a8bfe5510 100644 --- a/src/dpp/voice/enabled/handle_frame.cpp +++ b/src/dpp/voice/enabled/handle_frame.cpp @@ -465,9 +465,9 @@ bool discord_voice_client::handle_frame(const std::string &data, ws_opcode opcod udp_events = dpp::socket_events( fd, WANT_READ | WANT_WRITE | WANT_ERROR, - [this](socket fd, const struct socket_events &e) { read_ready(); }, - [this](socket fd, const struct socket_events &e) { write_ready(); }, - [this](socket fd, const struct socket_events &e, int error_code) { + [this](socket, const struct socket_events &e) { read_ready(); }, + [this](socket, const struct socket_events &e) { write_ready(); }, + [this](socket, const struct socket_events &e, int error_code) { this->close(); } ); diff --git a/src/dpp/voice/enabled/read_write.cpp b/src/dpp/voice/enabled/read_write.cpp index e131caf784..5512f08c1c 100644 --- a/src/dpp/voice/enabled/read_write.cpp +++ b/src/dpp/voice/enabled/read_write.cpp @@ -36,13 +36,13 @@ void discord_voice_client::send(const char* packet, size_t len, uint64_t duratio std::lock_guard lock(this->stream_mutex); outbuf.emplace_back(frame); - if (!this->sent_stop_frames) { - udp_events.flags = WANT_READ | WANT_WRITE | WANT_ERROR; - owner->socketengine->update_socket(udp_events); - } } else [[unlikely]] { this->udp_send(packet, len); } + if (!this->sent_stop_frames) { + udp_events.flags = WANT_READ | WANT_WRITE | WANT_ERROR; + owner->socketengine->update_socket(udp_events); + } } int discord_voice_client::udp_send(const char* data, size_t length) {