Skip to content

Commit 255619c

Browse files
committed
fixed:init and desotry function not work for srt of macro
1 parent 68a7c74 commit 255619c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Srt/ModuleHelp_SrtCore.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@
1313
*********************************************************************/
1414
CModuleHelp_SrtCore::CModuleHelp_SrtCore()
1515
{
16+
#if 1 == _XENGINE_STREAMMEDIA_BUILDSWITCH_SRT
17+
srt_startup();
18+
srt_setloglevel(srt_logging::LogLevel::fatal);
19+
#endif
1620
}
1721
CModuleHelp_SrtCore::~CModuleHelp_SrtCore()
1822
{
23+
#if 1 == _XENGINE_STREAMMEDIA_BUILDSWITCH_SRT
24+
srt_cleanup();
25+
#endif
1926
}
2027
//////////////////////////////////////////////////////////////////////////
2128
// 公有函数

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_StreamMediaApp.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ void ServiceApp_Stop(int signo)
9292
ModuleHelp_SrtCore_Destory();
9393
ModuleHelp_SRTPCore_Destory();
9494
HLSProtocol_M3u8Packet_Delete(xhHLSFile);
95-
srt_cleanup();
96-
95+
9796
HelpComponents_XLog_Destroy(xhLog);
9897
if (NULL != pSt_AFile)
9998
{
@@ -142,8 +141,6 @@ static int ServiceApp_Deamon()
142141

143142
int main(int argc, char** argv)
144143
{
145-
srt_startup();
146-
srt_setloglevel(srt_logging::LogLevel::fatal);
147144
#ifdef _MSC_BUILD
148145
WSADATA st_WSAData;
149146
WSAStartup(MAKEWORD(2, 2), &st_WSAData);
@@ -627,7 +624,6 @@ int main(int argc, char** argv)
627624
ModuleHelp_SrtCore_Destory();
628625
ModuleHelp_SRTPCore_Destory();
629626
HLSProtocol_M3u8Packet_Delete(xhHLSFile);
630-
srt_cleanup();
631627

632628
HelpComponents_XLog_Destroy(xhLog);
633629
if (NULL != pSt_AFile)

0 commit comments

Comments
 (0)