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

RingBuffer::availForPut() : remove

check is already done in RingBuffer::Put
parent bc47e2da
No related branches found
No related tags found
No related merge requests found
......@@ -50,18 +50,9 @@ void AudioLayer::flushUrgent (void)
int AudioLayer::putUrgent (void* buffer, int toCopy)
{
int a;
ost::MutexLock guard (_mutex);
a = _urgentRingBuffer.AvailForPut();
if (a >= toCopy) {
return _urgentRingBuffer.Put (buffer, toCopy);
} else {
return _urgentRingBuffer.Put (buffer, a);
}
return 0;
}
int AudioLayer::putMain (void *buffer, int toCopy, std::string call_id)
......
......@@ -303,24 +303,10 @@ int MainBuffer::putData (void *buffer, int toCopy, std::string call_id)
ost::MutexLock guard (_mutex);
RingBuffer* ring_buffer = getRingBuffer (call_id);
if (ring_buffer == NULL) {
if (!ring_buffer)
return 0;
}
int a;
a = ring_buffer->AvailForPut();
if (a >= toCopy) {
return ring_buffer->Put (buffer, toCopy);
} else {
return ring_buffer->Put (buffer, a);
}
}
int MainBuffer::getData (void *buffer, int toCopy, std::string call_id)
......
......@@ -178,13 +178,6 @@ RingBuffer::getNbReadPointer()
//
// For the writer only:
//
int
RingBuffer::AvailForPut()
{
// Always keep 4 bytes safe (?)
return mBufferSize - putLen();
}
// This one puts some data inside the ring buffer.
int
......
......@@ -94,12 +94,6 @@ class RingBuffer
int getNbReadPointer();
/**
* To get how much space is available in the buffer to write in
* @return int The available size
*/
int AvailForPut (void);
/**
* Write data in the ring buffer
* @param buffer Data to copied
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment