fix another buffering regression

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11152 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-01-12 23:14:55 +00:00
parent d042b78efb
commit f5ece7dc15
2 changed files with 4 additions and 3 deletions

View File

@ -32,7 +32,7 @@
*/
#include <switch.h>
/* for apr_pstrcat */
#define DEFAULT_PREBUFFER_SIZE 1024 * 32
#define DEFAULT_PREBUFFER_SIZE 1024 * 64
SWITCH_MODULE_LOAD_FUNCTION(mod_local_stream_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_local_stream_shutdown);

View File

@ -158,8 +158,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh,
int asis = switch_test_flag(fh, SWITCH_FILE_NATIVE);
if (!switch_test_flag(fh, SWITCH_FILE_BUFFER_DONE)) {
if (!switch_buffer_inuse(fh->pre_buffer)) {
rlen = asis ? fh->pre_buffer_datalen : fh->pre_buffer_datalen / 2;
rlen = asis ? fh->pre_buffer_datalen : fh->pre_buffer_datalen / 2;
if (switch_buffer_inuse(fh->pre_buffer) < rlen * 2) {
if ((status = fh->file_interface->file_read(fh, fh->pre_buffer_data, &rlen)) != SWITCH_STATUS_SUCCESS || !rlen) {
switch_set_flag(fh, SWITCH_FILE_BUFFER_DONE);
} else {