[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/audiofileio/decode AbstractAudioRe...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src/audiofileio/decode AbstractAudioRe... |
Date: |
Mon, 28 Jan 2008 21:09:56 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 08/01/28 21:09:56
Modified files:
src/audiofileio/decode: AbstractAudioReader.cpp
Log message:
* enable DecodeBuffer buffer management again (VERY simplistic, but
hey, that's how I work :P )
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/audiofileio/decode/AbstractAudioReader.cpp?cvsroot=traverso&r1=1.22&r2=1.23
Patches:
Index: AbstractAudioReader.cpp
===================================================================
RCS file:
/sources/traverso/traverso/src/audiofileio/decode/AbstractAudioReader.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- AbstractAudioReader.cpp 3 Dec 2007 21:13:30 -0000 1.22
+++ AbstractAudioReader.cpp 28 Jan 2008 21:09:56 -0000 1.23
@@ -188,7 +188,7 @@
void DecodeBuffer::check_buffers_capacity(uint size, uint channels)
{
-/* m_bufferSizeCheckCounter++;
+ m_bufferSizeCheckCounter++;
m_totalCheckSize += size;
float meanvalue = (m_totalCheckSize / (float)m_bufferSizeCheckCounter);
@@ -196,12 +196,12 @@
if (meanvalue < destinationBufferSize && ((meanvalue + 256) <
destinationBufferSize) && !(destinationBufferSize == size)) {
m_smallerReadCounter++;
if (m_smallerReadCounter > 8) {
-// Force recreation of the buffers;
- destinationBufferSize = readBufferSize = 0;
+ delete_destination_buffers();
+ delete_readbuffer();
m_bufferSizeCheckCounter = m_smallerReadCounter = 0;
m_totalCheckSize = 0;
}
- }*/
+ }
if (destinationBufferSize < size || m_channels < channels) {
@@ -217,7 +217,7 @@
}
destinationBufferSize = size;
-// printf("id %lld :: resizing destination to %.3f KB\n", id,
(float)size*4/1024);
+// printf("resizing destination to %.3f KB\n", (float)size*4/1024);
}
if (readBufferSize < (size*m_channels)) {
@@ -232,12 +232,6 @@
void DecodeBuffer::delete_destination_buffers()
{
if (destination) {
- uint destChannelcount = (sizeof(destination) /
sizeof(destination[0]));
- if (destChannelcount != m_channels) {
- PERROR("destination channel count != m_channels: dest
channel %d, m_channels %d", destChannelcount, m_channels);
- m_channels = destChannelcount;
- }
-
for (uint chan = 0; chan < m_channels; chan++) {
delete [] destination[chan];
}
@@ -246,6 +240,7 @@
destination = 0;
destinationBufferSize = 0;
+ m_channels = 0;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Traverso-commit] traverso/src/audiofileio/decode AbstractAudioRe...,
Remon Sijrier <=