mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
计算dts逻辑兼容一些奇怪的rtsp流:#1031
This commit is contained in:
parent
07c5341fb0
commit
bb63273c73
@ -169,8 +169,13 @@ bool H264RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtp) {
|
||||
}
|
||||
|
||||
void H264RtpDecoder::outputFrame(const RtpPacket::Ptr &rtp, const H264Frame::Ptr &frame) {
|
||||
if (frame->dropAble()) {
|
||||
//不参与dts生成
|
||||
frame->_dts = frame->_pts;
|
||||
} else {
|
||||
//rtsp没有dts,那么根据pts排序算法生成dts
|
||||
_dts_generator.getDts(frame->_pts, frame->_dts);
|
||||
}
|
||||
|
||||
if (frame->keyFrame() && _gop_dropped) {
|
||||
_gop_dropped = false;
|
||||
|
@ -222,8 +222,13 @@ bool H265RtpDecoder::singleFrame(const RtpPacket::Ptr &rtp, const uint8_t *ptr,
|
||||
}
|
||||
|
||||
void H265RtpDecoder::outputFrame(const RtpPacket::Ptr &rtp, const H265Frame::Ptr &frame) {
|
||||
if (frame->dropAble()) {
|
||||
//不参与dts生成
|
||||
frame->_dts = frame->_pts;
|
||||
} else {
|
||||
//rtsp没有dts,那么根据pts排序算法生成dts
|
||||
_dts_generator.getDts(frame->_pts, frame->_dts);
|
||||
}
|
||||
|
||||
if (frame->keyFrame() && _gop_dropped) {
|
||||
_gop_dropped = false;
|
||||
|
Loading…
Reference in New Issue
Block a user