Skip to content

Commit c43fe42

Browse files
committed
Fixup to TS-SRT after port of WHIP push socket changes
1 parent 8076d5e commit c43fe42

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/socket_srt.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,12 @@ namespace Socket{
167167
int local_listen_callback(void* ptrs, SRTSOCKET ns, int hs_version, const struct sockaddr* peeraddr, const char* streamid){
168168
((void**)ptrs)[2] = ((char*)0) + ns;
169169
if (Triggers::shouldTrigger("SRT_ACCEPT")){
170-
std::string localIP, remoteIP;
171-
uint32_t localPort, remotePort;
172170
paramList & P = *((paramList*)((void**)ptrs)[0]);
173-
((UDPConnection*)((void**)ptrs)[1])->GetLocalDestination(localIP, localPort);
174-
((UDPConnection*)((void**)ptrs)[1])->GetDestination(remoteIP, remotePort);
171+
const Socket::Address & localAddr = ((UDPConnection*)((void**)ptrs)[1])->getLocalAddr();
172+
const Socket::Address & remoteAddr = ((UDPConnection*)((void**)ptrs)[1])->getRemoteAddr();
175173
std::string sid(streamid);
176174
Util::replace(sid, "\n", "\\n");
177-
std::string payload = localIP + ":" + JSON::Value(localPort).asString() + "\n" + remoteIP + ":" + JSON::Value(remotePort).asString() + "\n" + sid;
175+
std::string payload = localAddr.toString() + "\n" + remoteAddr.toString() + "\n" + sid;
178176
std::string newArgs;
179177
Triggers::doTrigger("SRT_ACCEPT", payload, "", false, newArgs);
180178
if (!newArgs.size()){return -1;}

0 commit comments

Comments
 (0)