FS-6713 #resolve

This commit is contained in:
Anthony Minessale 2014-08-04 23:50:31 +05:00
parent 82330aa5d0
commit 1960533260
2 changed files with 36 additions and 32 deletions

View File

@ -223,7 +223,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
do_write = switch_buffer_inuse(bug->raw_write_buffer);
switch_mutex_unlock(bug->write_mutex);
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(switch_core_media_bug_get_session(bug)), SWITCH_LOG_ERROR,
"READ BUFFER %ld WRITE BUFFER %ld\n", do_read, do_write);
if (bug->record_frame_size && bug->record_pre_buffer_max && (do_read || do_write) && bug->record_pre_buffer_count < bug->record_pre_buffer_max) {
bug->record_pre_buffer_count++;
return SWITCH_STATUS_FALSE;

View File

@ -1263,7 +1263,7 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
frame.data = data;
frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
for (;;) {
status = switch_core_media_bug_read(bug, &frame, SWITCH_FALSE);
if (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK) {
@ -1302,6 +1302,9 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
}
}
}
} else {
break;
}
}
}
break;