Skip to content

Commit 0b27ea6

Browse files
committed
aplay/mixer: do not store particp sockaddr_storage
The participant sockaddr_storage doesn't need to be stored - actually the participands are stored inside a map, whose key is the sockaddr_storage. this modifies the commit 225fbc8 (2024-11-13, and later fixes)
1 parent 23197c9 commit 0b27ea6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/audio/playback/mixer.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ static void mixer_dummy_rtp_callback(struct rtp *session [[gnu::unused]], rtp_ev
127127
struct am_participant {
128128
am_participant(struct socket_udp_local *l, struct sockaddr_storage *ss,
129129
string const &audio_codec)
130-
: m_remote_addr(*ss)
131130
{
132131
assert(l != nullptr && ss != nullptr);
133132
m_buffer = audio_buffer_init(SAMPLE_RATE, BPS, CHANNELS, get_commandline_param("low-latency-audio") ? 50 : 5);
@@ -167,7 +166,6 @@ struct am_participant {
167166
m_network_device = std::move(other.m_network_device);
168167
m_tx_session = std::move(other.m_tx_session);
169168
last_seen = std::move(other.last_seen);
170-
m_remote_addr = std::move(other.m_remote_addr);
171169
other.m_audio_coder = nullptr;
172170
other.m_buffer = nullptr;
173171
other.m_tx_session = nullptr;
@@ -177,7 +175,6 @@ struct am_participant {
177175
am_participant(am_participant && other) {
178176
*this = std::move(other);
179177
}
180-
struct sockaddr_storage m_remote_addr;
181178
struct audio_codec_state *m_audio_coder;
182179
struct audio_buffer *m_buffer;
183180
struct rtp *m_network_device;
@@ -341,8 +338,7 @@ void state_audio_mixer::worker()
341338
char buf[ADDR_STR_BUF_LEN];
342339
MSG(NOTICE, "removed participant: %s\n",
343340
get_sockaddr_str(
344-
(const struct sockaddr *) &it->second
345-
.m_remote_addr,
341+
(const struct sockaddr *) &it->first,
346342
buf, sizeof buf));
347343
it = participants.erase(it);
348344
} else {

0 commit comments

Comments
 (0)