From 7a2702788f8fb5d39cd14007b23bbadcd34e41ed Mon Sep 17 00:00:00 2001 From: beveloper Date: Sun, 29 Feb 2004 22:25:05 +0000 Subject: [PATCH] fixed assigned BBuffer size, the size of a buffer is now the requested size, not the allocated size git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6824 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/media/BufferGroup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kits/media/BufferGroup.cpp b/src/kits/media/BufferGroup.cpp index 9770262608..6ccd8721b3 100644 --- a/src/kits/media/BufferGroup.cpp +++ b/src/kits/media/BufferGroup.cpp @@ -112,10 +112,10 @@ BBufferGroup::BBufferGroup(size_t size, } // first we roundup for a better placement in memory - size = (size + 63) & ~63; + int allocsize = (size + 63) & ~63; // now we create the area - area_size = ((size * count) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1); + area_size = ((allocsize * count) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1); buffer_area = create_area("some buffers area", &start_addr,placement,area_size,lock,B_READ_AREA | B_WRITE_AREA); if (buffer_area < B_OK) { @@ -128,7 +128,7 @@ BBufferGroup::BBufferGroup(size_t size, for (int32 i = 0; i < count; i++) { bci.area = buffer_area; - bci.offset = i * size; + bci.offset = i * allocsize; bci.size = size; buffer = new BBuffer(bci); if (0 == buffer->Data()) {