Skip to content

Commit 005debc

Browse files
committed
fixed:get media id incorrect for rtc push
1 parent 75db98c commit 005debc

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/StreamMedia_PushStream/PushStream_ClientWebRtc.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,14 @@ bool PushStream_ClientProtocol_Thread()
180180
RTPProtocol_Parse_GetPool(1, &ppSt_ListAddr, &nListCount);
181181
for (int i = 0; i < nListCount; i++)
182182
{
183+
int nVideoIndex = 0;
184+
int nAudioIndex = 0;
185+
ModuleSession_PushStream_RTCIndexGet(ppSt_ListAddr[i]->tszClientAddr, &nVideoIndex, &nAudioIndex);
183186
while (true)
184187
{
185188
STREAMMEDIA_RTPPROTOCOL_HDR st_RTPHdr = {};
186189
int nMSGLen = 0;
187-
st_RTPHdr.nPayID = 96;
190+
st_RTPHdr.nPayID = nVideoIndex;
188191
XCHAR* ptszMSGBuffer = NULL;
189192
if (!RTPProtocol_Parse_Recv(ppSt_ListAddr[i]->tszClientAddr, &ptszMSGBuffer, &nMSGLen, &st_RTPHdr))
190193
{
@@ -197,7 +200,7 @@ bool PushStream_ClientProtocol_Thread()
197200
{
198201
STREAMMEDIA_RTPPROTOCOL_HDR st_RTPHdr = {};
199202
int nMSGLen = 0;
200-
st_RTPHdr.nPayID = 111;
203+
st_RTPHdr.nPayID = nAudioIndex;
201204
XCHAR* ptszMSGBuffer = NULL;
202205
if (!RTPProtocol_Parse_Recv(ppSt_ListAddr[i]->tszClientAddr, &ptszMSGBuffer, &nMSGLen, &st_RTPHdr))
203206
{

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_StreamMediaApp.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,14 @@ int main(int argc, char** argv)
771771

772772
ManagePool_Memory_Destory(xhMemoryPool);
773773
HelpComponents_XLog_Destroy(xhLog);
774+
775+
if (NULL != pSTD_RTCThread)
776+
{
777+
if (pSTD_RTCThread->joinable())
778+
{
779+
pSTD_RTCThread->join();
780+
}
781+
}
774782
if (NULL != pSt_AFile)
775783
{
776784
fclose(pSt_AFile);

0 commit comments

Comments
 (0)