FS-7236 refactor to fix audio problem from 7c6367052c

This commit is contained in:
Anthony Minessale 2015-02-12 10:44:42 -06:00
parent 18313699fc
commit 5904bec1b6
1 changed files with 15 additions and 12 deletions

View File

@ -9578,16 +9578,7 @@ SWITCH_STANDARD_APP(conference_function)
member.channel = switch_core_session_get_channel(session);
member.pool = switch_core_session_get_pool(session);
if (!(mid = switch_channel_get_private(channel, "__confmid"))) {
mid = switch_core_session_alloc(session, sizeof(*mid));
*mid = next_member_id();
switch_channel_set_private(channel, "__confmid", mid);
}
switch_channel_set_variable_printf(channel, "conference_member_id", "%u", *mid);
/* Prepare MUTEXS */
member.id = *mid;
switch_mutex_init(&member.flag_mutex, SWITCH_MUTEX_NESTED, member.pool);
switch_mutex_init(&member.write_mutex, SWITCH_MUTEX_NESTED, member.pool);
switch_mutex_init(&member.read_mutex, SWITCH_MUTEX_NESTED, member.pool);
@ -9596,14 +9587,26 @@ SWITCH_STANDARD_APP(conference_function)
switch_mutex_init(&member.audio_out_mutex, SWITCH_MUTEX_NESTED, member.pool);
switch_thread_rwlock_create(&member.rwlock, member.pool);
/* Install our Signed Linear codec so we get the audio in that format */
switch_core_session_set_read_codec(member.session, &member.read_codec);
if (setup_media(&member, conference)) {
//flags = 0;
goto done;
}
if (!(mid = switch_channel_get_private(channel, "__confmid"))) {
mid = switch_core_session_alloc(session, sizeof(*mid));
*mid = next_member_id();
switch_channel_set_private(channel, "__confmid", mid);
}
switch_channel_set_variable_printf(channel, "conference_member_id", "%u", *mid);
member.id = *mid;
/* Install our Signed Linear codec so we get the audio in that format */
switch_core_session_set_read_codec(member.session, &member.read_codec);
mflags = conference->mflags;
set_mflags(flags_str, &mflags);
mflags |= MFLAG_RUNNING;