mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
fix cpu
This commit is contained in:
+5
-8
@@ -1046,13 +1046,13 @@ var
|
||||
i, n, Enc: Integer;
|
||||
Pkt: array of Byte;
|
||||
begin
|
||||
if not FRunning then begin AudioLog('EXIT: FRunning=false'); Exit; end;
|
||||
if not FRunning then Exit;
|
||||
FClientLock.Enter;
|
||||
HasWs := FClientCount > 0;
|
||||
FClientLock.Leave;
|
||||
if not HasWs then begin AudioLog('EXIT: FClientCount=0'); Exit; end;
|
||||
if (Samples = nil) or (Count <= 0) then begin AudioLog('EXIT: Samples nil/Count=0'); Exit; end;
|
||||
if not FOpusReady then begin AudioLog('EXIT: FOpusReady=false'); Exit; end;
|
||||
if not HasWs then Exit;
|
||||
if (Samples = nil) or (Count <= 0) then Exit;
|
||||
if not FOpusReady then Exit;
|
||||
|
||||
i := 0;
|
||||
while i < Count do
|
||||
@@ -1073,10 +1073,7 @@ begin
|
||||
Pkt[0] := WS_MSG_AUDIO;
|
||||
Move(FOpusOut[0], Pkt[1], Enc);
|
||||
BroadcastBinary(Pkt[0], Length(Pkt));
|
||||
AudioLog('SENT opus bytes=' + IntToStr(Enc) + ' clients=' + IntToStr(FClientCount));
|
||||
end
|
||||
else
|
||||
AudioLog('ENCODE FAILED Enc=' + IntToStr(Enc));
|
||||
end;
|
||||
FOpusBufPos := 0;
|
||||
end;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user