fix ambed to allow it to be used by multiple xlxd

the static Ip var was being shared by all instances of cstream class, then using same ambed by multiple xlxd's (on different ip's) would be a problem, we can just use m_Ip (that already stores the ip of the client reflector, set by controller class when creating cstream) to send packets back
This commit is contained in:
narspt 2022-04-02 21:55:41 +01:00 committed by GitHub
parent 53fdde921e
commit b962b4883e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,7 +174,7 @@ void CStream::Thread(CStream *This)
void CStream::Task(void)
{
CBuffer Buffer;
static CIp Ip;
CIp Ip;
uint8 uiPid;
uint8 Ambe[AMBE_FRAME_SIZE];
CAmbePacket *packet;
@ -207,7 +207,7 @@ void CStream::Task(void)
queue->pop();
// send it to client
EncodeDvFramePacket(&Buffer, packet->GetPid(), packet->GetAmbe());
m_Socket.Send(Buffer, Ip, m_uiPort);
m_Socket.Send(Buffer, m_Ip, m_uiPort);
// and done
delete packet;
}