[pulseaudio-commits] r1327 - /trunk/src/modules/module-solaris.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Aug 23 00:57:45 PDT 2006


Author: ossman
Date: Wed Aug 23 09:57:43 2006
New Revision: 1327

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1327&root=pulseaudio&view=rev
Log:
Make the recording a bit more chunky so that we can fit in the pool and have
efficient blocks.

Modified:
    trunk/src/modules/module-solaris.c

Modified: trunk/src/modules/module-solaris.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-solaris.c?rev=1327&root=pulseaudio&r1=1326&r2=1327&view=diff
==============================================================================
--- trunk/src/modules/module-solaris.c (original)
+++ trunk/src/modules/module-solaris.c Wed Aug 23 09:57:43 2006
@@ -82,6 +82,8 @@
 
     pa_memchunk memchunk;
 
+    unsigned int page_size;
+
     uint32_t frame_size;
     uint32_t buffer_size;
     unsigned int written_bytes, read_bytes;
@@ -193,7 +195,8 @@
 
 static void do_read(struct userdata *u) {
     pa_memchunk memchunk;
-    int err, l;
+    int err;
+    size_t l;
     ssize_t r;
     assert(u);
     
@@ -204,6 +207,11 @@
 
     err = ioctl(u->fd, I_NREAD, &l);
     assert(err >= 0);
+
+    /* This is to make sure it fits in the memory pool. Also, a page
+       should be the most efficient transfer size. */
+    if (l > u->page_size)
+        l = u->page_size;
 
     memchunk.memblock = pa_memblock_new(u->core->mempool, l);
     assert(memchunk.memblock);
@@ -589,6 +597,10 @@
 
     u->memchunk.memblock = NULL;
     u->memchunk.length = 0;
+
+    /* We use this to get a reasonable chunk size */
+    u->page_size = sysconf(_SC_PAGESIZE);
+
     u->frame_size = pa_frame_size(&ss);
     u->buffer_size = buffer_size;
 




More information about the pulseaudio-commits mailing list