Compare commits

..

No commits in common. "2bbd177d5a68e1dff83cc81afaae706c58f81a12" and "7b1f8fedac14482a71b3bff63fa8a324261c15c6" have entirely different histories.

4 changed files with 5 additions and 53 deletions

View File

@ -18,7 +18,7 @@ jobs:
with:
repository: cisco/libsrtp
fetch-depth: 1
ref: v2.3.0
ref: v2.7.0
path: 3rdpart/libsrtp
- name: 下载 openssl

View File

@ -38,8 +38,7 @@ bool G711RtpEncoder::inputFrame(const Frame::Ptr &frame) {
_buffer.append(ptr, size);
while (_buffer.size() >= _pkt_bytes) {
auto tmp = (in_pts+_pkt_dur_ms-1)/_pkt_dur_ms*_pkt_dur_ms;
RtpCodec::inputRtp(getRtpInfo().makeRtp(TrackAudio, _buffer.data(), _pkt_bytes, false, tmp), false);
RtpCodec::inputRtp(getRtpInfo().makeRtp(TrackAudio, _buffer.data(), _pkt_bytes, false, in_pts), false);
in_pts += _pkt_dur_ms;
_buffer.erase(0, _pkt_bytes);
}

View File

@ -15,12 +15,6 @@
#if !defined(ANDROID)
#include <execinfo.h>
#endif//!defined(ANDROID)
#else
#include <fcntl.h>
#include <io.h>
#include <Windows.h>
#include <DbgHelp.h>
#pragma comment(lib, "DbgHelp.lib")
#endif//!defined(_WIN32)
#include <cstdlib>
@ -219,48 +213,6 @@ void System::systemSetup(){
// Ignore the hang up signal
signal(SIGHUP, SIG_IGN);
#endif// ANDROID
#else
// 避免系统弹窗导致程序阻塞,适合无界面或后台服务场景。
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
#if !defined(__MINGW32__)
// 将assert和error时错误输出
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);
#endif
_setmode(0, _O_BINARY);
_setmode(1, _O_BINARY);
_setmode(2, _O_BINARY);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
std::ios_base::sync_with_stdio(false);
// 注册crash自动生成dump等价core dump
SetUnhandledExceptionFilter([](EXCEPTION_POINTERS *pException) -> LONG {
// 生成 dump 文件名,带时间戳
char dumpPath[MAX_PATH];
std::time_t t = std::time(nullptr);
std::tm tm;
#ifdef _MSC_VER
localtime_s(&tm, &t);
#else
tm = *std::localtime(&t);
#endif
std::strftime(dumpPath, sizeof(dumpPath), "crash_%Y%m%d_%H%M%S.dmp", &tm);
HANDLE hFile = CreateFileA(dumpPath, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hFile != INVALID_HANDLE_VALUE) {
MINIDUMP_EXCEPTION_INFORMATION mdei;
mdei.ThreadId = GetCurrentThreadId();
mdei.ExceptionPointers = pException;
mdei.ClientPointers = FALSE;
MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpNormal, &mdei, nullptr, nullptr);
CloseHandle(hFile);
}
return EXCEPTION_EXECUTE_HANDLER;
});
#endif//!defined(_WIN32)
}

View File

@ -41,7 +41,9 @@
#include "ZLMVersion.h"
#endif
#if !defined(_WIN32)
#include "System.h"
#endif//!defined(_WIN32)
using namespace std;
using namespace toolkit;
@ -257,11 +259,10 @@ int start_main(int argc,char *argv[]) {
// Start daemon process
System::startDaemon(kill_parent_if_failed);
}
#endif //! defined(_WIN32)
// 开启崩溃捕获等 [AUTO-TRANSLATED:9c7c759c]
// Enable crash capture, etc.
System::systemSetup();
#endif//!defined(_WIN32)
// 启动异步日志线程 [AUTO-TRANSLATED:c93cc6f4]
// Start asynchronous log thread