| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 { | 63 { |
| 64 m_mediaElement->setAudioSourceNode(0); | 64 m_mediaElement->setAudioSourceNode(0); |
| 65 uninitialize(); | 65 uninitialize(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void MediaElementAudioSourceNode::setFormat(size_t numberOfChannels, float sourc
eSampleRate) | 68 void MediaElementAudioSourceNode::setFormat(size_t numberOfChannels, float sourc
eSampleRate) |
| 69 { | 69 { |
| 70 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_so
urceSampleRate) { | 70 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_so
urceSampleRate) { |
| 71 if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfCha
nnels() || sourceSampleRate < minSampleRate || sourceSampleRate > maxSampleRate)
{ | 71 if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfCha
nnels() || sourceSampleRate < minSampleRate || sourceSampleRate > maxSampleRate)
{ |
| 72 // process() will generate silence for these uninitialized values. | 72 // process() will generate silence for these uninitialized values. |
| 73 LOG(Media, "MediaElementAudioSourceNode::setFormat(%u, %f) - unhandl
ed format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate); | 73 LOG_INFO(Media, "MediaElementAudioSourceNode::setFormat(%u, %f) - un
handled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRat
e); |
| 74 m_sourceNumberOfChannels = 0; | 74 m_sourceNumberOfChannels = 0; |
| 75 m_sourceSampleRate = 0; | 75 m_sourceSampleRate = 0; |
| 76 return; | 76 return; |
| 77 } | 77 } |
| 78 | 78 |
| 79 m_sourceNumberOfChannels = numberOfChannels; | 79 m_sourceNumberOfChannels = numberOfChannels; |
| 80 m_sourceSampleRate = sourceSampleRate; | 80 m_sourceSampleRate = sourceSampleRate; |
| 81 | 81 |
| 82 // Synchronize with process(). | 82 // Synchronize with process(). |
| 83 Locker<MediaElementAudioSourceNode> locker(*this); | 83 Locker<MediaElementAudioSourceNode> locker(*this); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 void MediaElementAudioSourceNode::unlock() | 147 void MediaElementAudioSourceNode::unlock() |
| 148 { | 148 { |
| 149 m_processLock.unlock(); | 149 m_processLock.unlock(); |
| 150 deref(); | 150 deref(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace WebCore | 153 } // namespace WebCore |
| 154 | 154 |
| 155 #endif // ENABLE(WEB_AUDIO) | 155 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |