mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-20 09:07:52 +01:00
Stop simulations when a LOG_END event is reached.
When a LOG_END event is reached, it makes no sense to continue simulating NetEq. Bug: webrtc:9667 Change-Id: Ie4f6811cdec0d0632f6e7906059e0e74e9f10438 Reviewed-on: https://webrtc-review.googlesource.com/c/105643 Reviewed-by: Björn Terelius <terelius@webrtc.org> Reviewed-by: Minyue Li <minyue@webrtc.org> Commit-Queue: Ivo Creusen <ivoc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25176}
This commit is contained in:
parent
961dbeac82
commit
ed04912ccd
1 changed files with 14 additions and 4 deletions
|
@ -68,9 +68,16 @@ bool RtcEventLogSource::OpenFile(const std::string& file_name,
|
|||
if (!parsed_log.ParseFile(file_name))
|
||||
return false;
|
||||
|
||||
const auto first_log_end_time_us =
|
||||
parsed_log.stop_log_events().empty()
|
||||
? std::numeric_limits<int64_t>::max()
|
||||
: parsed_log.stop_log_events().front().log_time_us();
|
||||
|
||||
auto handle_rtp_packet =
|
||||
[this](const webrtc::LoggedRtpPacketIncoming& incoming) {
|
||||
if (!filter_.test(incoming.rtp.header.payloadType)) {
|
||||
[this,
|
||||
first_log_end_time_us](const webrtc::LoggedRtpPacketIncoming& incoming) {
|
||||
if (!filter_.test(incoming.rtp.header.payloadType) &&
|
||||
incoming.log_time_us() < first_log_end_time_us) {
|
||||
rtp_packets_.emplace_back(absl::make_unique<Packet>(
|
||||
incoming.rtp.header, incoming.rtp.total_length,
|
||||
incoming.rtp.total_length - incoming.rtp.header_length,
|
||||
|
@ -79,8 +86,11 @@ bool RtcEventLogSource::OpenFile(const std::string& file_name,
|
|||
};
|
||||
|
||||
auto handle_audio_playout =
|
||||
[this](const webrtc::LoggedAudioPlayoutEvent& audio_playout) {
|
||||
audio_outputs_.emplace_back(audio_playout.log_time_ms());
|
||||
[this, first_log_end_time_us](
|
||||
const webrtc::LoggedAudioPlayoutEvent& audio_playout) {
|
||||
if (audio_playout.log_time_us() < first_log_end_time_us) {
|
||||
audio_outputs_.emplace_back(audio_playout.log_time_ms());
|
||||
}
|
||||
};
|
||||
|
||||
// This wouldn't be needed if we knew that there was at most one audio stream.
|
||||
|
|
Loading…
Reference in a new issue