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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 m_inputs.append(input); | 93 m_inputs.append(input); |
94 } | 94 } |
95 | 95 |
96 void AudioNode::addOutput(PassOwnPtr<AudioNodeOutput> output) | 96 void AudioNode::addOutput(PassOwnPtr<AudioNodeOutput> output) |
97 { | 97 { |
98 m_outputs.append(output); | 98 m_outputs.append(output); |
99 } | 99 } |
100 | 100 |
101 AudioNodeInput* AudioNode::input(unsigned i) | 101 AudioNodeInput* AudioNode::input(unsigned i) |
102 { | 102 { |
103 return m_inputs[i].get(); | 103 if (i < m_inputs.size()) |
| 104 return m_inputs[i].get(); |
| 105 return 0; |
104 } | 106 } |
105 | 107 |
106 AudioNodeOutput* AudioNode::output(unsigned i) | 108 AudioNodeOutput* AudioNode::output(unsigned i) |
107 { | 109 { |
108 return m_outputs[i].get(); | 110 if (i < m_outputs.size()) |
| 111 return m_outputs[i].get(); |
| 112 return 0; |
109 } | 113 } |
110 | 114 |
111 bool AudioNode::connect(AudioNode* destination, unsigned outputIndex, unsigned i
nputIndex) | 115 bool AudioNode::connect(AudioNode* destination, unsigned outputIndex, unsigned i
nputIndex) |
112 { | 116 { |
113 ASSERT(isMainThread()); | 117 ASSERT(isMainThread()); |
114 AudioContext::AutoLocker locker(context()); | 118 AudioContext::AutoLocker locker(context()); |
115 | 119 |
116 // Sanity check input and output indices. | 120 // Sanity check input and output indices. |
117 if (outputIndex >= numberOfOutputs()) | 121 if (outputIndex >= numberOfOutputs()) |
118 return false; | 122 return false; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 printf("%d: %d\n", i, s_nodeCount[i]); | 320 printf("%d: %d\n", i, s_nodeCount[i]); |
317 | 321 |
318 printf("===========================\n\n\n"); | 322 printf("===========================\n\n\n"); |
319 } | 323 } |
320 | 324 |
321 #endif // DEBUG_AUDIONODE_REFERENCES | 325 #endif // DEBUG_AUDIONODE_REFERENCES |
322 | 326 |
323 } // namespace WebCore | 327 } // namespace WebCore |
324 | 328 |
325 #endif // ENABLE(WEB_AUDIO) | 329 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |