| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 | 614 |
| 615 // replace mixed audio with Dtmf tone | 615 // replace mixed audio with Dtmf tone |
| 616 if (_audioFrame.num_channels_ == 1) | 616 if (_audioFrame.num_channels_ == 1) |
| 617 { | 617 { |
| 618 // mono | 618 // mono |
| 619 memcpy(_audioFrame.data_, toneBuffer, sizeof(int16_t) | 619 memcpy(_audioFrame.data_, toneBuffer, sizeof(int16_t) |
| 620 * toneSamples); | 620 * toneSamples); |
| 621 } else | 621 } else |
| 622 { | 622 { |
| 623 // stereo | 623 // stereo |
| 624 for (int i = 0; i < _audioFrame.samples_per_channel_; i++) | 624 for (size_t i = 0; i < _audioFrame.samples_per_channel_; i++) |
| 625 { | 625 { |
| 626 _audioFrame.data_[2 * i] = toneBuffer[i]; | 626 _audioFrame.data_[2 * i] = toneBuffer[i]; |
| 627 _audioFrame.data_[2 * i + 1] = 0; | 627 _audioFrame.data_[2 * i + 1] = 0; |
| 628 } | 628 } |
| 629 } | 629 } |
| 630 assert(_audioFrame.samples_per_channel_ == toneSamples); | 630 assert(_audioFrame.samples_per_channel_ == toneSamples); |
| 631 | 631 |
| 632 return 0; | 632 return 0; |
| 633 } | 633 } |
| 634 | 634 |
| 635 } // namespace voe | 635 } // namespace voe |
| 636 } // namespace webrtc | 636 } // namespace webrtc |
| OLD | NEW |