Merge remote-tracking branch 'upstream/master'

This commit is contained in:
monktan 2020-12-14 09:56:22 +08:00
commit 63867bc8c2
3 changed files with 12 additions and 3 deletions

@ -1 +1 @@
Subproject commit 42139e18ce46869760cc29f77ad6ce5de1f5dcee
Subproject commit 7ae5f547c17ddc7bee7b82ebc114248df99de620

View File

@ -26,7 +26,14 @@ MediaPlayer::~MediaPlayer() {
static void setOnCreateSocket_l(const std::shared_ptr<PlayerBase> &delegate, const Socket::onCreateSocket &cb){
auto helper = dynamic_pointer_cast<SocketHelper>(delegate);
if (helper) {
helper->setOnCreateSocket(cb);
if (cb) {
helper->setOnCreateSocket(cb);
} else {
//客户端,确保开启互斥锁
helper->setOnCreateSocket([](const EventPoller::Ptr &poller) {
return Socket::createSocket(poller, true);
});
}
}
}

View File

@ -602,7 +602,9 @@ const char* RtmpProtocol::handle_rtmp(const char *data, uint64_t len) {
//need more data
return ptr;
}
chunk_data.buffer.append(ptr + header_len + offset, more);
if (more) {
chunk_data.buffer.append(ptr + header_len + offset, more);
}
ptr += header_len + offset + more;
len -= header_len + offset + more;
if (chunk_data.buffer.size() == chunk_data.body_size) {