OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 m_isCleared = true; | 180 m_isCleared = true; |
181 } | 181 } |
182 | 182 |
183 void AudioContext::uninitialize() | 183 void AudioContext::uninitialize() |
184 { | 184 { |
185 ASSERT(isMainThread()); | 185 ASSERT(isMainThread()); |
186 | 186 |
187 if (!isInitialized()) | 187 if (!isInitialized()) |
188 return; | 188 return; |
189 | 189 |
| 190 m_isInitialized = false; |
| 191 |
190 // This stops the audio thread and all audio rendering. | 192 // This stops the audio thread and all audio rendering. |
191 m_destinationNode->uninitialize(); | 193 m_destinationNode->uninitialize(); |
192 | 194 |
193 if (!isOfflineContext()) { | 195 if (!isOfflineContext()) { |
194 ASSERT(s_hardwareContextCount); | 196 ASSERT(s_hardwareContextCount); |
195 --s_hardwareContextCount; | 197 --s_hardwareContextCount; |
196 } | 198 } |
197 | 199 |
198 // Get rid of the sources which may still be playing. | 200 // Get rid of the sources which may still be playing. |
199 derefUnfinishedSourceNodes(); | 201 derefUnfinishedSourceNodes(); |
200 | 202 |
201 m_isInitialized = false; | |
202 clear(); | 203 clear(); |
203 } | 204 } |
204 | 205 |
205 void AudioContext::stop() | 206 void AudioContext::stop() |
206 { | 207 { |
207 // Usually ExecutionContext calls stop twice. | 208 // Usually ExecutionContext calls stop twice. |
208 if (m_isStopScheduled) | 209 if (m_isStopScheduled) |
209 return; | 210 return; |
210 m_isStopScheduled = true; | 211 m_isStopScheduled = true; |
211 | 212 |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 | 866 |
866 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k
!= m_deferredCountModeChange.end(); ++k) | 867 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k
!= m_deferredCountModeChange.end(); ++k) |
867 (*k)->updateChannelCountMode(); | 868 (*k)->updateChannelCountMode(); |
868 | 869 |
869 m_deferredCountModeChange.clear(); | 870 m_deferredCountModeChange.clear(); |
870 } | 871 } |
871 | 872 |
872 } // namespace blink | 873 } // namespace blink |
873 | 874 |
874 #endif // ENABLE(WEB_AUDIO) | 875 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |