FSCORE-320
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12428 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
df13840625
commit
59de6b8c5e
|
@ -122,7 +122,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
|
|||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (!(bug->raw_read_buffer && bug->raw_write_buffer)) {
|
||||
if (!(bug->raw_read_buffer && (bug->raw_write_buffer || !switch_test_flag(bug, SMBF_WRITE_STREAM)))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%sBuffer Error\n", switch_channel_get_name(bug->session->channel));
|
||||
}
|
||||
|
||||
|
@ -136,13 +136,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
|
|||
}
|
||||
switch_mutex_unlock(bug->read_mutex);
|
||||
|
||||
switch_mutex_lock(bug->write_mutex);
|
||||
datalen = (uint32_t) switch_buffer_read(bug->raw_write_buffer, bug->data, bytes);
|
||||
if (datalen < bytes) {
|
||||
memset(((unsigned char *)bug->data) + datalen, 0, bytes - datalen);
|
||||
datalen = bytes;
|
||||
if (switch_test_flag(bug, SMBF_WRITE_STREAM)) {
|
||||
switch_mutex_lock(bug->write_mutex);
|
||||
datalen = (uint32_t) switch_buffer_read(bug->raw_write_buffer, bug->data, bytes);
|
||||
if (datalen < bytes) {
|
||||
memset(((unsigned char *)bug->data) + datalen, 0, bytes - datalen);
|
||||
datalen = bytes;
|
||||
}
|
||||
switch_mutex_unlock(bug->write_mutex);
|
||||
}
|
||||
switch_mutex_unlock(bug->write_mutex);
|
||||
|
||||
tp = bug->tmp;
|
||||
dp = (int16_t *) bug->data;
|
||||
|
|
Loading…
Reference in New Issue