Chromium Code Reviews| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 { | 66 { |
| 67 m_mediaElement->setAudioSourceNode(nullptr); | 67 m_mediaElement->setAudioSourceNode(nullptr); |
| 68 AudioHandler::dispose(); | 68 AudioHandler::dispose(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void MediaElementAudioSourceHandler::setFormat(size_t numberOfChannels, float so urceSampleRate) | 71 void MediaElementAudioSourceHandler::setFormat(size_t numberOfChannels, float so urceSampleRate) |
| 72 { | 72 { |
| 73 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_so urceSampleRate) { | 73 if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_so urceSampleRate) { |
| 74 if (!numberOfChannels || numberOfChannels > AbstractAudioContext::maxNum berOfChannels() || !AudioUtilities::isValidAudioBufferSampleRate(sourceSampleRat e)) { | 74 if (!numberOfChannels || numberOfChannels > AbstractAudioContext::maxNum berOfChannels() || !AudioUtilities::isValidAudioBufferSampleRate(sourceSampleRat e)) { |
| 75 // process() will generate silence for these uninitialized values. | 75 // process() will generate silence for these uninitialized values. |
| 76 WTF_LOG(Media, "MediaElementAudioSourceNode::setFormat(%u, %f) - unh andled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate ); | 76 DVLOG(3) << "setFormat(" << numberOfChannels << ", " << sourceSample Rate << ") - unhandled format change"; |
|
Raymond Toy
2016/05/19 14:48:42
How did you decide on 3?
Doesn't WTF_LOG always p
Srirama
2016/05/19 14:54:44
We are using 3 in core/html media files, to make i
Raymond Toy
2016/05/19 15:31:37
I see.
I think these are fairly rare. Can we jus
Srirama
2016/05/20 07:33:39
Even WTF_LOG will print only in debug mode and if
| |
| 77 // Synchronize with process(). | 77 // Synchronize with process(). |
| 78 Locker<MediaElementAudioSourceHandler> locker(*this); | 78 Locker<MediaElementAudioSourceHandler> locker(*this); |
| 79 m_sourceNumberOfChannels = 0; | 79 m_sourceNumberOfChannels = 0; |
| 80 m_sourceSampleRate = 0; | 80 m_sourceSampleRate = 0; |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 | 83 |
| 84 // Synchronize with process() to protect m_sourceNumberOfChannels, | 84 // Synchronize with process() to protect m_sourceNumberOfChannels, |
| 85 // m_sourceSampleRate, and m_multiChannelResampler. | 85 // m_sourceSampleRate, and m_multiChannelResampler. |
| 86 Locker<MediaElementAudioSourceHandler> locker(*this); | 86 Locker<MediaElementAudioSourceHandler> locker(*this); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 mediaElementAudioSourceHandler().lock(); | 244 mediaElementAudioSourceHandler().lock(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void MediaElementAudioSourceNode::unlock() | 247 void MediaElementAudioSourceNode::unlock() |
| 248 { | 248 { |
| 249 mediaElementAudioSourceHandler().unlock(); | 249 mediaElementAudioSourceHandler().unlock(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace blink | 252 } // namespace blink |
| 253 | 253 |
| OLD | NEW |