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
pull/216/head
narspt 4 years ago committed by GitHub
parent 53fdde921e
commit b962b4883e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save

Powered by TurnKey Linux.