From b962b4883ea795ef5139bcff5b3165c9a2eb3c31 Mon Sep 17 00:00:00 2001 From: narspt Date: Sat, 2 Apr 2022 21:55:41 +0100 Subject: [PATCH] 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 --- ambed/cstream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ambed/cstream.cpp b/ambed/cstream.cpp index 6a4a94b..2986c85 100644 --- a/ambed/cstream.cpp +++ b/ambed/cstream.cpp @@ -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; }