1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Prevent the output of srt logs in utest. v5.0.181 v6.0.79 (#3807)

Prevent the output of srt logs in utest.

---------

Co-authored-by: chundonglinlin <chundonglinlin@163.com>
This commit is contained in:
john 2023-09-21 15:37:24 +08:00 committed by GitHub
parent 8c67889860
commit 03d1d91f2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_REVISION 180
#define VERSION_REVISION 181
#endif

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 6
#define VERSION_MINOR 0
#define VERSION_REVISION 78
#define VERSION_REVISION 79
#endif

View file

@ -21,6 +21,7 @@ using namespace std;
#include <sys/mman.h>
#ifdef SRS_SRT
#include <srt/srt.h>
#include <srs_app_srt_server.hpp>
#endif
@ -45,6 +46,14 @@ const char* _srs_binary = NULL;
#include <srs_app_st.hpp>
#ifdef SRS_SRT
static void srs_srt_utest_null_log_handler(void* opaque, int level, const char* file, int line,
const char* area, const char* message)
{
// srt null log handler, do no print any log.
}
#endif
// Initialize global settings.
srs_error_t prepare_main() {
srs_error_t err = srs_success;
@ -72,6 +81,9 @@ srs_error_t prepare_main() {
return srs_error_wrap(err, "srt log initialize");
}
// Prevent the output of srt logs in utest.
srt_setloghandler(NULL, srs_srt_utest_null_log_handler);
_srt_eventloop = new SrsSrtEventLoop();
if ((err = _srt_eventloop->initialize()) != srs_success) {
return srs_error_wrap(err, "srt poller initialize");