mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-15 12:35:58 +08:00
优化rtmp性能
This commit is contained in:
@@ -319,7 +319,7 @@ void RtmpPlayer::onStreamDry(uint32_t stream_index) {
|
||||
onPlayResult_l(SockException(Err_other, "rtmp stream dry"), true);
|
||||
}
|
||||
|
||||
void RtmpPlayer::onMediaData_l(const RtmpPacket::Ptr &chunk_data) {
|
||||
void RtmpPlayer::onMediaData_l(RtmpPacket::Ptr chunk_data) {
|
||||
_rtmp_recv_ticker.resetTime();
|
||||
if (!_play_timer) {
|
||||
//已经触发了onPlayResult事件,直接触发onMediaData事件
|
||||
@@ -338,8 +338,8 @@ void RtmpPlayer::onMediaData_l(const RtmpPacket::Ptr &chunk_data) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RtmpPlayer::onRtmpChunk(RtmpPacket &chunk_data) {
|
||||
void RtmpPlayer::onRtmpChunk(RtmpPacket::Ptr packet) {
|
||||
auto &chunk_data = *packet;
|
||||
typedef void (RtmpPlayer::*rtmp_func_ptr)(AMFDecoder &dec);
|
||||
static unordered_map<string, rtmp_func_ptr> s_func_map;
|
||||
static onceToken token([]() {
|
||||
@@ -379,7 +379,7 @@ void RtmpPlayer::onRtmpChunk(RtmpPacket &chunk_data) {
|
||||
}
|
||||
_metadata_got = true;
|
||||
}
|
||||
onMediaData_l(std::make_shared<RtmpPacket>(std::move(chunk_data)));
|
||||
onMediaData_l(std::move(packet));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user