FS-4896 please try this

This commit is contained in:
Anthony Minessale 2012-11-30 13:54:15 -06:00
parent 4dac7d91a2
commit 6496b80ded
1 changed files with 10 additions and 20 deletions

View File

@ -183,18 +183,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
bytes = read_impl.decoded_bytes_per_packet;
#ifdef TESTINGONLY
if (0 && bug->session->recur_buffer_len) {
frame->datalen = bug->session->recur_buffer_len;
frame->samples = bug->session->recur_buffer_len / sizeof(int16_t);
frame->rate = read_impl.actual_samples_per_second;
frame->codec = NULL;
memcpy(frame->data, bug->session->recur_buffer, bug->session->recur_buffer_len);
return SWITCH_STATUS_SUCCESS;
}
#endif
if (frame->buflen < bytes) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(switch_core_media_bug_get_session(bug)), SWITCH_LOG_ERROR, "%s frame buffer too small!\n",
switch_channel_get_name(bug->session->channel));
@ -232,15 +220,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
}
if (!bug->record_frame_size) {
if (do_read && do_write) {
switch_size_t frame_size;
switch_codec_implementation_t read_impl = { 0 };
switch_codec_implementation_t other_read_impl = { 0 };
switch_core_session_t *other_session;
switch_core_session_get_read_impl(bug->session, &read_impl);
frame_size = read_impl.decoded_bytes_per_packet;
switch_size_t frame_size;
switch_codec_implementation_t read_impl = { 0 };
//switch_codec_implementation_t other_read_impl = { 0 };
//switch_core_session_t *other_session;
switch_core_session_get_read_impl(bug->session, &read_impl);
frame_size = read_impl.decoded_bytes_per_packet;
bug->record_frame_size = frame_size;
#if 0
if (do_read && do_write) {
if (switch_core_session_get_partner(bug->session, &other_session) == SWITCH_STATUS_SUCCESS) {
switch_core_session_get_read_impl(other_session, &other_read_impl);
switch_core_session_rwunlock(other_session);
@ -258,6 +247,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
bug->record_frame_size = frame_size;
}
#endif
}