mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
修复rtsp推流访问空指针的bug:#1456
This commit is contained in:
parent
7f66e6b4bf
commit
8324a9fe43
@ -170,9 +170,6 @@ void RtspSession::onWholeRtspPacket(Parser &parser) {
|
||||
void RtspSession::onRtpPacket(const char *data, size_t len) {
|
||||
uint8_t interleaved = data[1];
|
||||
if (interleaved % 2 == 0) {
|
||||
if (!_push_src) {
|
||||
return;
|
||||
}
|
||||
auto track_idx = getTrackIndexByInterleaved(interleaved);
|
||||
handleOneRtp(track_idx, _sdp_track[track_idx]->_type, _sdp_track[track_idx]->_samplerate, (uint8_t *) data + RtpPacket::kRtpTcpHeaderSize, len - RtpPacket::kRtpTcpHeaderSize);
|
||||
} else {
|
||||
@ -950,7 +947,11 @@ void RtspSession::send_NotAcceptable() {
|
||||
}
|
||||
|
||||
void RtspSession::onRtpSorted(RtpPacket::Ptr rtp, int track_idx) {
|
||||
_push_src->onWrite(std::move(rtp), false);
|
||||
if (_push_src) {
|
||||
_push_src->onWrite(std::move(rtp), false);
|
||||
} else {
|
||||
WarnL << "Not a rtsp push!";
|
||||
}
|
||||
}
|
||||
|
||||
void RtspSession::onRcvPeerUdpData(int interleaved, const Buffer::Ptr &buf, const struct sockaddr &addr) {
|
||||
|
Loading…
Reference in New Issue
Block a user