[Freeswitch-trunk] [commit] r12428 - freeswitch/trunk/src
FreeSWITCH SVN
anthm at freeswitch.org
Wed Mar 4 15:15:13 PST 2009
Author: anthm
Date: Wed Mar 4 17:15:13 2009
New Revision: 12428
Log:
FSCORE-320
Modified:
freeswitch/trunk/src/switch_core_media_bug.c
Modified: freeswitch/trunk/src/switch_core_media_bug.c
==============================================================================
--- freeswitch/trunk/src/switch_core_media_bug.c (original)
+++ freeswitch/trunk/src/switch_core_media_bug.c Wed Mar 4 17:15:13 2009
@@ -122,7 +122,7 @@
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_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;
More information about the Freeswitch-trunk
mailing list