Make force_fieldtrials persistent string during entire program live.
absl::GetFlag creates temporary string which is destroyed and c_str() points to wrong/empty place. Bug: webrtc:10616 Change-Id: Ie17f1530b1042978da78c79bb6754a65ff4e21eb Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145210 Commit-Queue: Ruslan Burakov <kuddai@google.com> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Ivo Creusen <ivoc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28529}
This commit is contained in:

committed by
Commit Bot

parent
a1471b7a55
commit
ca5f21e293
@ -336,8 +336,12 @@ int main(int argc, char* argv[]) {
|
||||
RTC_CHECK(ValidateExtensionId(absl::GetFlag(FLAGS_video_content_type)));
|
||||
RTC_CHECK(ValidateExtensionId(absl::GetFlag(FLAGS_video_timing)));
|
||||
|
||||
webrtc::field_trial::InitFieldTrialsFromString(
|
||||
absl::GetFlag(FLAGS_force_fieldtrials).c_str());
|
||||
// Make force_fieldtrials persistent string during entire program live as
|
||||
// absl::GetFlag creates temporary string and c_str() will point to
|
||||
// deallocated string.
|
||||
const std::string force_fieldtrials = absl::GetFlag(FLAGS_force_fieldtrials);
|
||||
webrtc::field_trial::InitFieldTrialsFromString(force_fieldtrials.c_str());
|
||||
|
||||
webrtc::test::NetEqTestFactory::Config config;
|
||||
config.pcmu = absl::GetFlag(FLAGS_pcmu);
|
||||
config.pcma = absl::GetFlag(FLAGS_pcma);
|
||||
|
Reference in New Issue
Block a user