Skip to content

Commit aa1cdb6

Browse files
committed
make the rtp lookup map insertion & removal more robust
1 parent eecec0e commit aa1cdb6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

webrtc-sys/src/user_timestamp.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ void UserTimestampTransformer::TransformReceive(
179179
recv_map_.erase(recv_map_order_.front());
180180
recv_map_order_.pop_front();
181181
}
182+
if (recv_map_.find(rtp_timestamp) == recv_map_.end()) {
183+
recv_map_order_.push_back(rtp_timestamp);
184+
}
182185
recv_map_[rtp_timestamp] = user_ts.value();
183-
recv_map_order_.push_back(rtp_timestamp);
184186
}
185187

186188
// Update frame with stripped data
@@ -372,8 +374,10 @@ void UserTimestampTransformer::store_user_timestamp(
372374
send_map_order_.pop_front();
373375
}
374376

377+
if (send_map_.find(key) == send_map_.end()) {
378+
send_map_order_.push_back(key);
379+
}
375380
send_map_[key] = user_timestamp_us;
376-
send_map_order_.push_back(key);
377381

378382
RTC_LOG(LS_INFO) << "UserTimestampTransformer::store_user_timestamp"
379383
<< " capture_ts_us=" << capture_timestamp_us

0 commit comments

Comments
 (0)