Ignore FEC packet in stats, if it is first packet on ssrc.
BUG=chrome:410456 R=mflodman@webrtc.org, tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/22309004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7096 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -408,36 +408,31 @@ ReceiveStatisticsImpl::~ReceiveStatisticsImpl() {
|
||||
void ReceiveStatisticsImpl::IncomingPacket(const RTPHeader& header,
|
||||
size_t bytes,
|
||||
bool retransmitted) {
|
||||
StatisticianImplMap::iterator it;
|
||||
StreamStatisticianImpl* impl;
|
||||
{
|
||||
CriticalSectionScoped cs(receive_statistics_lock_.get());
|
||||
it = statisticians_.find(header.ssrc);
|
||||
if (it == statisticians_.end()) {
|
||||
std::pair<StatisticianImplMap::iterator, uint32_t> insert_result =
|
||||
statisticians_.insert(std::make_pair(
|
||||
header.ssrc, new StreamStatisticianImpl(clock_, this, this)));
|
||||
it = insert_result.first;
|
||||
StatisticianImplMap::iterator it = statisticians_.find(header.ssrc);
|
||||
if (it != statisticians_.end()) {
|
||||
impl = it->second;
|
||||
} else {
|
||||
impl = new StreamStatisticianImpl(clock_, this, this);
|
||||
statisticians_[header.ssrc] = impl;
|
||||
}
|
||||
}
|
||||
it->second->IncomingPacket(header, bytes, retransmitted);
|
||||
// StreamStatisticianImpl instance is created once and only destroyed when
|
||||
// this whole ReceiveStatisticsImpl is destroyed. StreamStatisticianImpl has
|
||||
// it's own locking so don't hold receive_statistics_lock_ (potential
|
||||
// deadlock).
|
||||
impl->IncomingPacket(header, bytes, retransmitted);
|
||||
}
|
||||
|
||||
void ReceiveStatisticsImpl::FecPacketReceived(uint32_t ssrc) {
|
||||
CriticalSectionScoped cs(receive_statistics_lock_.get());
|
||||
StatisticianImplMap::iterator it = statisticians_.find(ssrc);
|
||||
assert(it != statisticians_.end());
|
||||
it->second->FecPacketReceived();
|
||||
}
|
||||
|
||||
void ReceiveStatisticsImpl::ChangeSsrc(uint32_t from_ssrc, uint32_t to_ssrc) {
|
||||
CriticalSectionScoped cs(receive_statistics_lock_.get());
|
||||
StatisticianImplMap::iterator from_it = statisticians_.find(from_ssrc);
|
||||
if (from_it == statisticians_.end())
|
||||
return;
|
||||
if (statisticians_.find(to_ssrc) != statisticians_.end())
|
||||
return;
|
||||
statisticians_[to_ssrc] = from_it->second;
|
||||
statisticians_.erase(from_it);
|
||||
// Ignore FEC if it is the first packet.
|
||||
if (it != statisticians_.end()) {
|
||||
it->second->FecPacketReceived();
|
||||
}
|
||||
}
|
||||
|
||||
StatisticianMap ReceiveStatisticsImpl::GetActiveStatisticians() const {
|
||||
|
||||
Reference in New Issue
Block a user