修复调用close_stream同时调用getMediaList引发的崩溃
This commit is contained in:
parent
81966f2c48
commit
138b83e5f0
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue