1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-11-27 04:34:42 +01:00

Fixed deadlock

This commit is contained in:
Grishka 2017-04-28 15:42:48 +03:00
parent 697e250727
commit 64276ceb96

View File

@ -167,10 +167,6 @@ void tgvoip::OpusDecoder::RunThread(){
size_t nextLen=0;
while(running){
//LOGV("after wait, running=%d", running);
if(!running){
LOGI("==== decoder exiting ====");
return;
}
//LOGD("Will get %d packets", packetsNeeded);
//lastDecodedLen=0;
memcpy(buffer, nextBuffer, nextLen);
@ -200,6 +196,10 @@ void tgvoip::OpusDecoder::RunThread(){
//LOGV("After decode, size=%d", size);
for(i=0;i<packetsPerFrame;i++){
semaphore.Acquire();
if(!running){
LOGI("==== decoder exiting ====");
return;
}
unsigned char *buf=bufferPool->Get();
if(buf){
if(size>0){