| Index: content/renderer/media/media_stream_dependency_factory.cc
|
| diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc
|
| index be33d64dc5fe5744042734105fbf7b80226edfb8..d7b27938a1afba81c8db2453d7f4d9edd6c0614b 100644
|
| --- a/content/renderer/media/media_stream_dependency_factory.cc
|
| +++ b/content/renderer/media/media_stream_dependency_factory.cc
|
| @@ -753,18 +753,34 @@ bool MediaStreamDependencyFactory::OnControlMessageReceived(
|
| void MediaStreamDependencyFactory::OnAecDumpFile(
|
| IPC::PlatformFileForTransit file_handle) {
|
| DCHECK_EQ(aec_dump_file_, base::kInvalidPlatformFileValue);
|
| - if (PeerConnectionFactoryCreated()) {
|
| - base::PlatformFile file =
|
| - IPC::PlatformFileForTransitToPlatformFile(file_handle);
|
| - DCHECK_NE(file, base::kInvalidPlatformFileValue);
|
| - StartAecDump(file);
|
| - } else {
|
| - aec_dump_file_ = IPC::PlatformFileForTransitToPlatformFile(file_handle);
|
| - DCHECK_NE(aec_dump_file_, base::kInvalidPlatformFileValue);
|
| + base::PlatformFile file =
|
| + IPC::PlatformFileForTransitToPlatformFile(file_handle);
|
| + DCHECK_NE(file, base::kInvalidPlatformFileValue);
|
| +
|
| + if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableAudioTrackProcessing)) {
|
| + EnsureWebRtcAudioDeviceImpl();
|
| + GetWebRtcAudioDevice()->EnableAecDump(file);
|
| + return;
|
| }
|
| +
|
| + // TODO(xians): Remove the following code after kEnableAudioTrackProcessing
|
| + // is removed.
|
| + if (PeerConnectionFactoryCreated())
|
| + StartAecDump(file);
|
| + else
|
| + aec_dump_file_ = file;
|
| }
|
|
|
| void MediaStreamDependencyFactory::OnDisableAecDump() {
|
| + if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableAudioTrackProcessing)) {
|
| + GetWebRtcAudioDevice()->DisableAecDump();
|
| + return;
|
| + }
|
| +
|
| + // TODO(xians): Remove the following code after kEnableAudioTrackProcessing
|
| + // is removed.
|
| if (aec_dump_file_ != base::kInvalidPlatformFileValue)
|
| base::ClosePlatformFile(aec_dump_file_);
|
| aec_dump_file_ = base::kInvalidPlatformFileValue;
|
|
|