FS-5930 --resolve this should suppress the message

This commit is contained in:
Anthony Minessale 2013-10-31 14:08:43 -05:00
parent f532640c49
commit c8b80cced6
1 changed files with 5 additions and 4 deletions

View File

@ -311,16 +311,17 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
if (!is_open || used >= source->prebuf || (source->total && used > source->samples * 2)) { if (!is_open || used >= source->prebuf || (source->total && used > source->samples * 2)) {
used = switch_buffer_read(audio_buffer, dist_buf, source->samples * 2); used = switch_buffer_read(audio_buffer, dist_buf, source->samples * 2);
if (source->total) { if (source->total) {
uint32_t used = 0;
switch_mutex_lock(source->mutex); switch_mutex_lock(source->mutex);
for (cp = source->context_list; cp && RUNNING; cp = cp->next) { for (cp = source->context_list; cp && RUNNING; cp = cp->next) {
if (switch_test_flag(cp->handle, SWITCH_FILE_CALLBACK)) { if (switch_test_flag(cp->handle, SWITCH_FILE_CALLBACK)) {
continue; continue;
} }
switch_mutex_lock(cp->audio_mutex); switch_mutex_lock(cp->audio_mutex);
if (switch_buffer_inuse(cp->audio_buffer) > source->samples * 768) { used = switch_buffer_inuse(cp->audio_buffer);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Leaking stream handle! [%s() %s:%d]\n", cp->func, cp->file, if (used > source->samples * 768) {
cp->line); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Flushing Stream Handle Buffer [%s() %s:%d] size: %u samples: %ld\n",
cp->func, cp->file, cp->line, used, (long)source->samples);
switch_buffer_zero(cp->audio_buffer); switch_buffer_zero(cp->audio_buffer);
} else { } else {
switch_buffer_write(cp->audio_buffer, dist_buf, used); switch_buffer_write(cp->audio_buffer, dist_buf, used);