mirror of
https://github.com/danog/libtgvoip.git
synced 2024-11-27 04:34:42 +01:00
Fixed deadlock
This commit is contained in:
parent
697e250727
commit
64276ceb96
@ -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){
|
||||
|
Loading…
Reference in New Issue
Block a user