mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-10 08:20:16 +00: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…
x
Reference in New Issue
Block a user