Move code for setting field trials from NetEqTestFactory to the main function in neteq_rtpplay.

It is problematic to set field trials more than once, so to avoid running into problems, this functionality has been placed in the main function of neteq_rtpplay.

Bug: webrtc:9667
Change-Id: Ib9b9990f30a1715b50889dbfc4d74787bcbe5dae
Reviewed-on: https://webrtc-review.googlesource.com/98541
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24673}
This commit is contained in:
Ivo Creusen
2018-09-11 10:30:58 +02:00
committed by Commit Bot
parent eb58464f82
commit f81b0f11a6
6 changed files with 70 additions and 54 deletions

View File

@ -344,6 +344,8 @@ if (rtc_include_tests) {
deps = [
":neteq_simulator_api",
"../modules/audio_coding:neteq_test_factory",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
"//third_party/abseil-cpp/absl/memory",
]
}

View File

@ -12,6 +12,8 @@
#include "absl/memory/memory.h"
#include "modules/audio_coding/neteq/tools/neteq_test_factory.h"
#include "rtc_base/checks.h"
#include "rtc_base/flags.h"
namespace webrtc {
namespace test {
@ -24,7 +26,11 @@ NetEqSimulatorFactory::~NetEqSimulatorFactory() = default;
std::unique_ptr<NetEqSimulator> NetEqSimulatorFactory::CreateSimulator(
int argc,
char* argv[]) {
return factory_->InitializeTest(argc, argv);
RTC_CHECK(!rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true))
<< "Error while parsing command-line flags";
RTC_CHECK_EQ(argc, 3) << "Wrong number of input arguments. Expected 3, got "
<< argc;
return factory_->InitializeTest(argv[1], argv[2]);
}
} // namespace test