This commit is contained in:
2026-03-08 22:34:18 +03:00
parent 811c96b36c
commit d347a26d6d
5 changed files with 519 additions and 546 deletions
+5 -8
View File
@@ -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;