diff --git a/CMakeLists.txt b/CMakeLists.txt index f2bcec71..1189dfc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,6 +113,10 @@ if(NOT WIN32) add_compile_options(-Wno-predefined-identifier-outside-function) endif() +if(WIN32) +list(APPEND LINK_LIB_LIST ws2_32) +endif() + #编译动态库 if(NOT IOS AND NOT ANDROID) add_library(${CMAKE_PROJECT_NAME}_shared SHARED ${SRC_LIST}) diff --git a/src/H264/SPSParser.c b/src/H264/SPSParser.c index 5fa0cb3c..13898161 100644 --- a/src/H264/SPSParser.c +++ b/src/H264/SPSParser.c @@ -19,8 +19,9 @@ #define MIN_LOG2_MAX_FRAME_NUM 4 #define H264_MAX_PICTURE_COUNT 36 #define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS. +#ifndef INT_MAX #define INT_MAX 65535 - +#endif //INT_MAX /* report level */ #define RPT_ERR (1) // error, system error diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 25aee438..8ac62a62 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,7 +39,7 @@ foreach(TEST_SRC ${TEST_SRC_LIST}) if(ANDROID) target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_static ${LINK_LIB_LIST}) elseif(WIN32) - target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_shared ${LINK_LIB_LIST}) + target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_shared ${LINK_LIB_LIST} ) else() target_link_libraries(${TEST_EXE_NAME} ${CMAKE_PROJECT_NAME}_shared ${LINK_LIB_LIST} pthread) endif() diff --git a/tests/test_server.cpp b/tests/test_server.cpp index 5df2b33e..2a13b281 100644 --- a/tests/test_server.cpp +++ b/tests/test_server.cpp @@ -136,7 +136,7 @@ static onceToken s_token([](){ }, nullptr); #if !defined(SIGHUP) -#defined SIGHUP 1 +#define SIGHUP 1 #endif int main(int argc,char *argv[]) { @@ -148,7 +148,10 @@ int main(int argc,char *argv[]) { Logger::Instance().add(std::make_shared("stdout", LTrace)); Logger::Instance().setWriter(std::make_shared()); //加载配置文件,如果配置文件不存在就创建一个 + InfoL << mINI::Instance().dump(); Config::loadIniConfig(); + InfoL << mINI::Instance().dump(); + { //这里是拉流地址,支持rtmp/rtsp协议,负载必须是H264+AAC