@@ -9,15 +9,16 @@ static XHANDLE xhPacket = NULL;
99static XHANDLE xhAudioFifo = NULL ;
1010static XNETHANDLE xhFilter = 0 ;
1111
12- void XCALLBACK HTTPTask_TaskPost_CBVideo (uint8_t * ptszAVBuffer, int nAVLen, AVCODEC_TIMESTAMP* pSt_TimeInfo , XPVOID lParam)
12+ void XCALLBACK HTTPTask_TaskPost_CBVideo (AVCODEC_VIDEO_MSGBUFFER* pSt_MSGBuffer , XPVOID lParam)
1313{
1414 int nListCount = 0 ;
1515 AVCODEC_VIDEO_MSGBUFFER** ppSt_MSGBuffer;
16- VideoCodec_Stream_EnCodec (xhVideo, ptszAVBuffer, nAVLen, &ppSt_MSGBuffer, &nListCount);
16+ pSt_MSGBuffer->st_TimeStamp = {};
17+ VideoCodec_Stream_EnCodec (xhVideo, pSt_MSGBuffer, &ppSt_MSGBuffer, &nListCount);
1718 for (int i = 0 ; i < nListCount; i++)
1819 {
19- AVFormat_Packet_StreamWrite (xhPacket, 0 , ppSt_MSGBuffer[i]->ptszAVBuffer , ppSt_MSGBuffer[i]->nAVLen , &ppSt_MSGBuffer[i]->st_TimeStamp );
20- BaseLib_Memory_FreeCStyle ((XPPMEM) &ppSt_MSGBuffer[i]->ptszAVBuffer );
20+ AVFormat_Packet_StreamWrite (xhPacket, 0 , ppSt_MSGBuffer[i]->st_MSGBuffer . unData . ptszMSGBuffer , ppSt_MSGBuffer[i]->st_MSGBuffer . nMSGLen [ 0 ] , &ppSt_MSGBuffer[i]->st_TimeStamp );
21+ BaseLib_Memory_MSGFree ( &ppSt_MSGBuffer[i]->st_MSGBuffer );
2122 }
2223 BaseLib_Memory_Free ((XPPPMEM)&ppSt_MSGBuffer, nListCount);
2324}
@@ -41,14 +42,14 @@ void XCALLBACK HTTPTask_TaskPost_CBAudio(AVCODEC_AUDIO_MSGBUFFER* pSt_MSGBuffer,
4142 AudioCodec_Stream_EnCodec (xhAudio, &st_MSGBuffer, &ppSt_AudioBuffer, &nAudioCount);
4243 for (int j = 0 ; j < nAudioCount; j++)
4344 {
44- AVFormat_Packet_StreamWrite (xhPacket, 1 , ppSt_AudioBuffer[j]->ptszMSGBuffer [0 ], ppSt_AudioBuffer[j]->nMSGLen [0 ], &ppSt_AudioBuffer[j]->st_TimeStamp );
45+ AVFormat_Packet_StreamWrite (xhPacket, 1 , ppSt_AudioBuffer[j]->st_MSGBuffer .unData .ptszMSGArray [0 ], ppSt_AudioBuffer[j]->st_MSGBuffer .nMSGLen [0 ], &ppSt_AudioBuffer[j]->st_TimeStamp );
46+ BaseLib_Memory_MSGFree (&ppSt_AudioBuffer[j]->st_MSGBuffer );
4547 }
46- AudioCodec_Stream_Free (&ppSt_AudioBuffer, nAudioCount);
47- AudioCodec_Stream_FreeBuffer (&st_MSGBuffer);
48+ BaseLib_Memory_Free ((XPPPMEM)&ppSt_AudioBuffer, nAudioCount);
4849 }
50+ BaseLib_Memory_MSGFree (&ppSt_MSGBuffer[i]->st_MSGBuffer );
4951 }
50- AudioCodec_Stream_Free (&ppSt_MSGBuffer, nListCount);
51- AudioCodec_Stream_FreeBuffer (pSt_MSGBuffer);
52+ BaseLib_Memory_Free ((XPPPMEM)&ppSt_MSGBuffer, nListCount);
5253}
5354
5455bool HTTPTask_TaskPost_BackService (LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, int nType)
0 commit comments