Переглянути джерело

Merge pull request #2273 from asymptotic-io/mod-conference-fix

[mod_conference] Avoid a race in member->read_impl access
Andrey Volk 1 рік тому
батько
коміт
11048483d3

+ 3 - 3
src/mod/applications/mod_conference/conference_loop.c

@@ -1316,15 +1316,15 @@ void conference_loop_output(conference_member_t *member)
 	uint32_t flush_len;
 	uint32_t low_count, bytes;
 	call_list_t *call_list, *cp;
-	switch_codec_implementation_t read_impl = { 0 }, real_read_impl = { 0 };
+	switch_codec_implementation_t real_read_impl = { 0 };
 	int sanity;
 
-	switch_core_session_get_read_impl(member->session, &read_impl);
+	switch_core_session_get_read_impl(member->session, &member->read_impl);
 	switch_core_session_get_real_read_impl(member->session, &real_read_impl);
 
 
 	channel = switch_core_session_get_channel(member->session);
-	interval = read_impl.microseconds_per_packet / 1000;
+	interval = member->read_impl.microseconds_per_packet / 1000;
 	samples = switch_samples_per_packet(member->conference->rate, interval);
 	//csamples = samples;
 	tsamples = real_read_impl.samples_per_packet;