修复调用close_stream同时调用getMediaList引发的崩溃

This commit is contained in:
waken 2023-08-30 17:20:43 +08:00
parent 81966f2c48
commit 138b83e5f0
1 changed files with 3 additions and 0 deletions

View File

@ -544,6 +544,9 @@ float RtspPlayer::getPacketLossRate(TrackType type) const {
size_t lost = 0, expected = 0;
try {
auto track_idx = getTrackIndexByTrackType(type);
if (_rtcp_context.empty()) {
return 0;
}
auto ctx = _rtcp_context[track_idx];
lost = ctx->getLost();
expected = ctx->getExpectedPackets();