[pulseaudio-commits] r1832 - /branches/lennart/src/pulsecore/pstream.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Sun Sep 16 14:58:05 PDT 2007
Author: lennart
Date: Sun Sep 16 23:58:04 2007
New Revision: 1832
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1832&root=pulseaudio&view=rev
Log:
split memblocks into multiples of the mempool tile size
Modified:
branches/lennart/src/pulsecore/pstream.c
Modified: branches/lennart/src/pulsecore/pstream.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/pstream.c?rev=1832&root=pulseaudio&r1=1831&r2=1832&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/pstream.c (original)
+++ branches/lennart/src/pulsecore/pstream.c Sun Sep 16 23:58:04 2007
@@ -40,16 +40,17 @@
#include <netinet/in.h>
#endif
-#include "winsock.h"
#include <pulse/xmalloc.h>
+#include <pulsecore/winsock.h>
#include <pulsecore/queue.h>
#include <pulsecore/log.h>
#include <pulsecore/core-scache.h>
#include <pulsecore/creds.h>
#include <pulsecore/refcnt.h>
#include <pulsecore/flist.h>
+#include <pulsecore/macro.h>
#include "pstream.h"
@@ -83,7 +84,6 @@
#define PA_PSTREAM_DESCRIPTOR_SIZE (PA_PSTREAM_DESCRIPTOR_MAX*sizeof(uint32_t))
#define FRAME_SIZE_MAX_ALLOW PA_SCACHE_ENTRY_SIZE_MAX /* allow uploading a single sample in one frame at max */
-#define FRAME_SIZE_MAX_USE (1024*64)
PA_STATIC_FLIST_DECLARE(items, 0, pa_xfree);
@@ -351,6 +351,7 @@
void pa_pstream_send_memblock(pa_pstream*p, uint32_t channel, int64_t offset, pa_seek_mode_t seek_mode, const pa_memchunk *chunk) {
size_t length, idx;
+ size_t bsm;
pa_assert(p);
pa_assert(PA_REFCNT_VALUE(p) > 0);
@@ -362,6 +363,8 @@
idx = 0;
length = chunk->length;
+
+ bsm = pa_mempool_block_size_max(p->mempool);
while (length > 0) {
struct item_info *i;
@@ -371,7 +374,7 @@
i = pa_xnew(struct item_info, 1);
i->type = PA_PSTREAM_ITEM_MEMBLOCK;
- n = length < FRAME_SIZE_MAX_USE ? length : FRAME_SIZE_MAX_USE;
+ n = MIN(length, bsm);
i->chunk.index = chunk->index + idx;
i->chunk.length = n;
i->chunk.memblock = pa_memblock_ref(chunk->memblock);
More information about the pulseaudio-commits
mailing list