Skip to content

Commit

Permalink
audio works if user joins 2nd
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Nov 25, 2024
1 parent a548c2c commit f21c6b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/dpp/voice/enabled/handle_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
);
Expand Down
8 changes: 4 additions & 4 deletions src/dpp/voice/enabled/read_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ void discord_voice_client::send(const char* packet, size_t len, uint64_t duratio

std::lock_guard<std::mutex> 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) {
Expand Down

0 comments on commit f21c6b9

Please sign in to comment.