Question about AudioLevelObserver::Update

void AudioLevelObserver::Update()
{
MS_TRACE();
std::map<int8_t, RTC::Producer*> mapDBovsProducer;
for (auto& kv : this->mapProducerDBovs)
{
auto* producer = kv.first;
auto& dBovs = kv.second;
if (dBovs.count < 10)
continue;
auto avgDBov = -1 * static_cast<int8_t>(std::lround(dBovs.totalSum / dBovs.count));
if (avgDBov >= this->threshold)
mapDBovsProducer[avgDBov] = producer;
}

Just a simple question about the following two lines:
if (avgDBov >= this->threshold)
mapDBovsProducer[avgDBov] = producer;

lets say if there are two producers with the same average volume number, the first added one will be overwritten by the second one, is this designated behavior?

does anyone know this?

Are you looking at mediasoup C++ code to implement your own server or SFU?

Hi Baz,

I am just interested in the mediasoup worker project, I found this when I was reading the code, not from any real product. From the code it is obviously a bug, but i am not sure.

It could be the way you say, right, but I’m not sure it’s a design error.

alright, thank you for the reply.