Skip to content
Snippets Groups Projects
Commit 1f47047e authored by Rafaël Carré's avatar Rafaël Carré
Browse files

RingBuffer::Put() : remove constant volume argument

parent 3a5b0231
No related branches found
No related tags found
No related merge requests found
......@@ -314,11 +314,11 @@ int MainBuffer::putData (void *buffer, int toCopy, std::string call_id)
if (a >= toCopy) {
return ring_buffer->Put (buffer, toCopy, 100);
return ring_buffer->Put (buffer, toCopy);
} else {
return ring_buffer->Put (buffer, a, 100);
return ring_buffer->Put (buffer, a);
}
}
......
......@@ -227,9 +227,8 @@ RingBuffer::AvailForPut()
}
// This one puts some data inside the ring buffer.
// Change the volume if it's not 100
int
RingBuffer::Put (void* buffer, int toCopy, unsigned short volume)
RingBuffer::Put (void* buffer, int toCopy)
{
samplePtr src;
int block;
......@@ -258,18 +257,6 @@ RingBuffer::Put (void* buffer, int toCopy, unsigned short volume)
block = mBufferSize - pos;
}
// Gain adjustment (when Mic vol. is changed)
if (volume != 100) {
SFLDataFormat* start = (SFLDataFormat*) src;
int nbSample = block / sizeof (SFLDataFormat);
for (int i=0; i<nbSample; i++) {
start[i] = start[i] * volume / 100;
}
}
// bcopy(src, dest, len)
//fprintf(stderr, "has %d put %d\t", len, block);
bcopy (src, mBuffer + pos, block);
src += block;
......
......@@ -107,10 +107,9 @@ class RingBuffer
* Write data in the ring buffer
* @param buffer Data to copied
* @param toCopy Number of bytes to copy
* @param volume The volume
* @return int Number of bytes copied
*/
int Put (void* buffer, int toCopy, unsigned short volume = 100);
int Put (void* buffer, int toCopy);
/**
* To get how much space is available in the buffer to read in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment