[cvs-annodex] commit (/annodex): mod_annodex-ap20/trunk/mod_annodex.c

conrad nobody at lists.annodex.net
Tue Sep 14 11:08:06 EST 2004


Update of /annodex (new revision 571)

Modified files:
   mod_annodex-ap20/trunk/mod_annodex.c

Log Message:
up media data buffer size within mod_annodex


Modified: mod_annodex-ap20/trunk/mod_annodex.c
===================================================================
--- mod_annodex-ap20/trunk/mod_annodex.c	2004-09-13 07:46:49 UTC (rev 570)
+++ mod_annodex-ap20/trunk/mod_annodex.c	2004-09-14 01:08:06 UTC (rev 571)
@@ -74,6 +74,8 @@
 
 #define MAX_ANCHOR_LEN 32768
 
+#define MEDIA_BUF_LEN 1024000
+
 /**
  * Print a time as npt using ap_rprintf
  * \param r the request record
@@ -268,11 +270,11 @@
   int ret;
   char * val;
   double seek_offset = 0.0, seek_end = -1.0;
-  char buf[1024];
-  long n = 1024;
+  char buf[MEDIA_BUF_LEN];
+  long n = MEDIA_BUF_LEN;
 
   anx = anx_new (ANX_WRITE);
-  anx_init_importers (ANX_MIME_TYPE);
+  anx_init_importers ("*/*");
   
   val = (char *)apr_table_get (cgi_table, "t");
   if (val) {
@@ -282,7 +284,7 @@
   ret = anx_write_import (anx, filename, NULL, content_type,
 			   seek_offset, seek_end, 0);
   
-  while ((n = anx_write_output (anx, buf, 1024)) > 0) {
+  while ((n = anx_write_output (anx, buf, MEDIA_BUF_LEN)) > 0) {
     ap_rwrite (buf, n, r);
   }
   
@@ -505,7 +507,7 @@
 
   /*s_seek_offset = seek_offset;*/
 
-  while ((n = anx_read (anx, 1024)) > 0);
+  while ((n = anx_read (anx, MEDIA_BUF_LEN)) > 0);
 
   if (anx_close (anx) != NULL) {
     /*exit_err ("Failed close of annodex");*/
@@ -518,8 +520,8 @@
 ma_send (request_rec * r, char * filename)
 {
   apr_file_t * af;
-  char buf[1024];
-  apr_size_t n = 1024;
+  char buf[MEDIA_BUF_LEN];
+  apr_size_t n = MEDIA_BUF_LEN;
 
   apr_file_open (&af, filename, APR_READ, APR_OS_DEFAULT, r->pool);
 


-- 
conrad



More information about the cvs-annodex mailing list