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

solve srt repush bugs (#1596)

* if there isn't srt connect, it needn't epoll wait

* solve repush srt bugs
This commit is contained in:
Alex.CR 2020-02-08 21:50:58 -06:00 committed by GitHub
parent bdc7973596
commit 3847807534
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 80 additions and 11 deletions

View file

@ -1,13 +1,22 @@
#include "srt_data.hpp"
#include <string.h>
SRT_DATA_MSG::SRT_DATA_MSG(unsigned int len, const std::string& path):_len(len)
SRT_DATA_MSG::SRT_DATA_MSG(const std::string& path, unsigned int msg_type):_msg_type(msg_type)
,_len(0)
,_data_p(nullptr)
,_key_path(path) {
}
SRT_DATA_MSG::SRT_DATA_MSG(unsigned int len, const std::string& path, unsigned int msg_type):_msg_type(msg_type)
,_len(len)
,_key_path(path) {
_data_p = new unsigned char[len];
memset(_data_p, 0, len);
}
SRT_DATA_MSG::SRT_DATA_MSG(unsigned char* data_p, unsigned int len, const std::string& path):_len(len)
SRT_DATA_MSG::SRT_DATA_MSG(unsigned char* data_p, unsigned int len, const std::string& path, unsigned int msg_type):_msg_type(msg_type)
,_len(len)
,_key_path(path)
{
_data_p = new unsigned char[len];
@ -15,7 +24,13 @@ SRT_DATA_MSG::SRT_DATA_MSG(unsigned char* data_p, unsigned int len, const std::s
}
SRT_DATA_MSG::~SRT_DATA_MSG() {
delete _data_p;
if (_data_p && (_len > 0)) {
delete _data_p;
}
}
unsigned int SRT_DATA_MSG::msg_type() {
return _msg_type;
}
std::string SRT_DATA_MSG::get_path() {