[Freeswitch-svn] [commit] r11152 - in freeswitch/trunk/src: . mod/formats/mod_local_stream

FreeSWITCH SVN anthm at freeswitch.org
Mon Jan 12 15:14:56 PST 2009


Author: anthm
Date: Mon Jan 12 17:14:55 2009
New Revision: 11152

Log:
fix another buffering regression

Modified:
   freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
   freeswitch/trunk/src/switch_core_file.c

Modified: freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c	(original)
+++ freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c	Mon Jan 12 17:14:55 2009
@@ -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);

Modified: freeswitch/trunk/src/switch_core_file.c
==============================================================================
--- freeswitch/trunk/src/switch_core_file.c	(original)
+++ freeswitch/trunk/src/switch_core_file.c	Mon Jan 12 17:14:55 2009
@@ -158,8 +158,9 @@
 		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 {



More information about the Freeswitch-svn mailing list