From 559b4d3fe73e28f21e8cad87ed727d4e5dc4b5bf Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Tue, 14 Jun 2022 19:49:45 +0800 Subject: [PATCH] for srt more check config --- srt/SrtTransportImp.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/srt/SrtTransportImp.cpp b/srt/SrtTransportImp.cpp index 1eb716c4..210498c2 100644 --- a/srt/SrtTransportImp.cpp +++ b/srt/SrtTransportImp.cpp @@ -323,12 +323,20 @@ void SrtTransportImp::doCachedFunc() { int SrtTransportImp::getLatencyMul() { GET_CONFIG(int, latencyMul, kLatencyMul); + if (latencyMul <= 0) { + WarnL << "config srt " << kLatencyMul << " not vaild"; + return 4; + } return latencyMul; } int SrtTransportImp::getPktBufSize() { // kPktBufSize GET_CONFIG(int, pktBufSize, kPktBufSize); + if (pktBufSize <= 0) { + WarnL << "config srt " << kPktBufSize << " not vaild"; + return 8912; + } return pktBufSize; }