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

MainBuffer::availForPut(): remove

check is already done in putData()
parent 29147e10
No related branches found
No related tags found
No related merge requests found
...@@ -66,19 +66,9 @@ int AudioLayer::putUrgent (void* buffer, int toCopy) ...@@ -66,19 +66,9 @@ int AudioLayer::putUrgent (void* buffer, int toCopy)
int AudioLayer::putMain (void *buffer, int toCopy, std::string call_id) int AudioLayer::putMain (void *buffer, int toCopy, std::string call_id)
{ {
int a;
ost::MutexLock guard (_mutex); ost::MutexLock guard (_mutex);
a = getMainBuffer()->availForPut (call_id);
if (a >= toCopy) {
return getMainBuffer()->putData (buffer, toCopy, call_id); return getMainBuffer()->putData (buffer, toCopy, call_id);
} else {
_debug ("Chopping sound, Ouch! RingBuffer full ?");
return getMainBuffer()->putData (buffer, a, call_id);
}
return 0;
} }
void AudioLayer::notifyincomingCall() void AudioLayer::notifyincomingCall()
......
...@@ -323,21 +323,6 @@ int MainBuffer::putData (void *buffer, int toCopy, std::string call_id) ...@@ -323,21 +323,6 @@ int MainBuffer::putData (void *buffer, int toCopy, std::string call_id)
} }
int MainBuffer::availForPut (std::string call_id)
{
ost::MutexLock guard (_mutex);
RingBuffer* ringbuffer = getRingBuffer (call_id);
if (ringbuffer == NULL)
return 0;
else
return ringbuffer->AvailForPut();
}
int MainBuffer::getData (void *buffer, int toCopy, std::string call_id) int MainBuffer::getData (void *buffer, int toCopy, std::string call_id)
{ {
ost::MutexLock guard (_mutex); ost::MutexLock guard (_mutex);
......
...@@ -93,8 +93,6 @@ class MainBuffer ...@@ -93,8 +93,6 @@ class MainBuffer
int getData (void *buffer, int toCopy, std::string call_id = default_id); int getData (void *buffer, int toCopy, std::string call_id = default_id);
int availForPut (std::string call_id = default_id);
int availForGet (std::string call_id = default_id); int availForGet (std::string call_id = default_id);
int discard (int toDiscard, std::string call_id = default_id); int discard (int toDiscard, std::string call_id = default_id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment