Fix buffer leak when the audio receive thread dies
This commit is contained in:
parent
a933886537
commit
cb43494cd0
1 changed files with 13 additions and 4 deletions
|
|
@ -158,7 +158,7 @@ static void ReceiveThreadProc(void* context) {
|
|||
if (packet == NULL) {
|
||||
Limelog("Audio Receive: malloc() failed\n");
|
||||
ListenerCallbacks.connectionTerminated(-1);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ static void ReceiveThreadProc(void* context) {
|
|||
Limelog("Audio Receive: recv() failed: %d\n", (int)LastSocketError());
|
||||
free(packet);
|
||||
ListenerCallbacks.connectionTerminated(LastSocketError());
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
if (packet->size < sizeof(RTP_PACKET)) {
|
||||
|
|
@ -189,7 +189,7 @@ static void ReceiveThreadProc(void* context) {
|
|||
if ((AudioCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
|
||||
if (!queuePacketToLbq(&packet)) {
|
||||
// An exit signal was received
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -208,16 +208,25 @@ static void ReceiveThreadProc(void* context) {
|
|||
if ((AudioCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
|
||||
if (!queuePacketToLbq(&packet)) {
|
||||
// An exit signal was received
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
decodeInputData(packet);
|
||||
}
|
||||
}
|
||||
|
||||
// Break on exit
|
||||
if (packet != NULL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (packet != NULL) {
|
||||
free(packet);
|
||||
}
|
||||
}
|
||||
|
||||
static void DecoderThreadProc(void* context) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue