| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 Locker<MediaElementAudioSourceHandler> locker(*this); | 86 Locker<MediaElementAudioSourceHandler> locker(*this); |
| 87 | 87 |
| 88 m_sourceNumberOfChannels = numberOfChannels; | 88 m_sourceNumberOfChannels = numberOfChannels; |
| 89 m_sourceSampleRate = sourceSampleRate; | 89 m_sourceSampleRate = sourceSampleRate; |
| 90 | 90 |
| 91 if (sourceSampleRate != sampleRate()) { | 91 if (sourceSampleRate != sampleRate()) { |
| 92 double scaleFactor = sourceSampleRate / sampleRate(); | 92 double scaleFactor = sourceSampleRate / sampleRate(); |
| 93 m_multiChannelResampler = adoptPtr(new MultiChannelResampler(scaleFa
ctor, numberOfChannels)); | 93 m_multiChannelResampler = adoptPtr(new MultiChannelResampler(scaleFa
ctor, numberOfChannels)); |
| 94 } else { | 94 } else { |
| 95 // Bypass resampling. | 95 // Bypass resampling. |
| 96 m_multiChannelResampler.clear(); | 96 m_multiChannelResampler.reset(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 { | 99 { |
| 100 // The context must be locked when changing the number of output cha
nnels. | 100 // The context must be locked when changing the number of output cha
nnels. |
| 101 AbstractAudioContext::AutoLocker contextLocker(context()); | 101 AbstractAudioContext::AutoLocker contextLocker(context()); |
| 102 | 102 |
| 103 // Do any necesssary re-configuration to the output's number of chan
nels. | 103 // Do any necesssary re-configuration to the output's number of chan
nels. |
| 104 output(0).setNumberOfChannels(numberOfChannels); | 104 output(0).setNumberOfChannels(numberOfChannels); |
| 105 } | 105 } |
| 106 } | 106 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 mediaElementAudioSourceHandler().lock(); | 242 mediaElementAudioSourceHandler().lock(); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void MediaElementAudioSourceNode::unlock() | 245 void MediaElementAudioSourceNode::unlock() |
| 246 { | 246 { |
| 247 mediaElementAudioSourceHandler().unlock(); | 247 mediaElementAudioSourceHandler().unlock(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace blink | 250 } // namespace blink |
| 251 | 251 |
| OLD | NEW |