From 756970153c04b95b35be1b29741e687b1d615a81 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 28 Dec 2007 19:47:51 +0000 Subject: [PATCH] fix MODAPP-59 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7002 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../mod_conference/mod_conference.c | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index ee155a4cd4..d52e6107e6 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -1909,8 +1909,9 @@ static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t * t switch_core_file_set_string(&fh, SWITCH_AUDIO_COL_STR_ARTIST, "FreeSWITCH mod_conference Software Conference Module"); while (switch_test_flag(member, MFLAG_RUNNING) && switch_test_flag(conference, CFLAG_RUNNING) && conference->count) { + switch_size_t len; mux_used = (uint32_t) switch_buffer_inuse(member->mux_buffer); - + if (switch_test_flag(member, MFLAG_FLUSH_BUFFER)) { if (mux_used) { switch_mutex_lock(member->audio_out_mutex); @@ -1928,18 +1929,26 @@ static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t * t if ((rlen = (uint32_t) switch_buffer_read(member->mux_buffer, data, sizeof(data)))) { if (!switch_test_flag((&fh), SWITCH_FILE_PAUSE)) { - switch_size_t len = (switch_size_t) rlen / sizeof(int16_t); - if (switch_core_file_write(&fh, data, &len) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Failed\n"); - switch_clear_flag_locked(member, MFLAG_RUNNING); - } + len = (switch_size_t) rlen / sizeof(int16_t); } } switch_mutex_unlock(member->audio_out_mutex); } else { - switch_core_timer_next(&timer); + if (!switch_test_flag((&fh), SWITCH_FILE_PAUSE)) { + len = (switch_size_t) samples; + memset(data, 0, len); + } } - } /* Rinse ... Repeat */ + + if (!switch_test_flag((&fh), SWITCH_FILE_PAUSE)) { + if (switch_core_file_write(&fh, data, &len) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Failed\n"); + switch_clear_flag_locked(member, MFLAG_RUNNING); + } + } + + switch_core_timer_next(&timer); + } /* Rinse ... Repeat */ end: