Compare commits

..

1 Commits

Author SHA1 Message Date
mtdxc
ea96d70f06
Merge e69c0e648c into cc590254a6 2024-10-31 08:27:52 +00:00
3 changed files with 4 additions and 6 deletions

View File

@ -346,7 +346,7 @@ public:
return it->second; return it->second;
} }
void for_each(const std::function<void(const std::string&, const Pointer&)>& cb) { void for_each(std::function<void(const std::string&, const Pointer&)> cb) {
std::lock_guard<std::recursive_mutex> lck(_mtx); std::lock_guard<std::recursive_mutex> lck(_mtx);
auto it = _map.begin(); auto it = _map.begin();
while (it != _map.end()) { while (it != _map.end()) {

View File

@ -126,7 +126,7 @@ bool MP4Recorder::inputFrame(const Frame::Ptr &frame) {
if (_last_dts == 0 || _last_dts > frame->dts()) { if (_last_dts == 0 || _last_dts > frame->dts()) {
// b帧情况下dts时间戳可能回退 [AUTO-TRANSLATED:1de38f77] // b帧情况下dts时间戳可能回退 [AUTO-TRANSLATED:1de38f77]
// In the case of b-frames, the dts timestamp may regress // In the case of b-frames, the dts timestamp may regress
_last_dts = MIN(frame->dts(), _last_dts); _last_dts = MAX(frame->dts(), _last_dts);
} }
auto duration = 5u; // 默认至少一帧5ms auto duration = 5u; // 默认至少一帧5ms
if (frame->dts() > 0 && frame->dts() > _last_dts) { if (frame->dts() > 0 && frame->dts() > _last_dts) {

View File

@ -296,12 +296,10 @@ void RtpServer::updateSSRC(uint32_t ssrc) {
} }
uint32_t RtpServer::getSSRC() const { uint32_t RtpServer::getSSRC() const {
if (_ssrc) { if (_ssrc)
return *_ssrc; return *_ssrc;
} else if (_tcp_server)
if (_tcp_server) {
return (*_tcp_server)[RtpSession::kSSRC]; return (*_tcp_server)[RtpSession::kSSRC];
}
return 0; return 0;
} }