Merge branch 'ZLMediaKit:master' into master
This commit is contained in:
commit
a31173c06d
|
|
@ -1590,12 +1590,14 @@ void installWebApi() {
|
||||||
auto record_path = Recorder::getRecordPath(Recorder::type_mp4, tuple, allArgs["customized_path"]);
|
auto record_path = Recorder::getRecordPath(Recorder::type_mp4, tuple, allArgs["customized_path"]);
|
||||||
auto period = allArgs["period"];
|
auto period = allArgs["period"];
|
||||||
record_path = record_path + period + "/";
|
record_path = record_path + period + "/";
|
||||||
|
|
||||||
|
bool recording = false;
|
||||||
auto name = allArgs["name"];
|
auto name = allArgs["name"];
|
||||||
if (!name.empty()) {
|
if (!name.empty()) {
|
||||||
|
// 删除指定文件
|
||||||
record_path += name;
|
record_path += name;
|
||||||
}
|
} else {
|
||||||
bool recording = false;
|
// 删除文件夹,先判断该流是否正在录制中
|
||||||
{
|
|
||||||
auto src = MediaSource::find(allArgs["vhost"], allArgs["app"], allArgs["stream"]);
|
auto src = MediaSource::find(allArgs["vhost"], allArgs["app"], allArgs["stream"]);
|
||||||
if (src && src->isRecording(Recorder::type_mp4)) {
|
if (src && src->isRecording(Recorder::type_mp4)) {
|
||||||
recording = true;
|
recording = true;
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,9 @@
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include "RtspSplitter.h"
|
#include "RtspSplitter.h"
|
||||||
#include "Util/logger.h"
|
|
||||||
#include "Util/util.h"
|
#include "Util/util.h"
|
||||||
|
#include "Util/logger.h"
|
||||||
|
#include "Common/macros.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace toolkit;
|
using namespace toolkit;
|
||||||
|
|
@ -64,7 +65,18 @@ ssize_t RtspSplitter::onRecvHeader(const char *data, size_t len) {
|
||||||
if (len == 4 && !memcmp(data, "\r\n\r\n", 4)) {
|
if (len == 4 && !memcmp(data, "\r\n\r\n", 4)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
_parser.parse(data, len);
|
try {
|
||||||
|
_parser.parse(data, len);
|
||||||
|
} catch (mediakit::AssertFailedException &ex){
|
||||||
|
if (!_enableRecvRtp) {
|
||||||
|
// 还在握手中,直接中断握手
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
// 握手已经结束,如果rtsp server存在发送缓存溢出的bug,那么rtsp信令可能跟rtp混在一起
|
||||||
|
// 这种情况下,rtsp信令解析异常不中断链接,只丢弃这个包
|
||||||
|
WarnL << ex.what();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
auto ret = getContentLength(_parser);
|
auto ret = getContentLength(_parser);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
onWholeRtspPacket(_parser);
|
onWholeRtspPacket(_parser);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue