forked from Mirrors/freeswitch
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:
parent
d042b78efb
commit
f5ece7dc15
@ -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);
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user