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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 return false; | 118 return false; |
119 if (destination && inputIndex >= destination->numberOfInputs()) | 119 if (destination && inputIndex >= destination->numberOfInputs()) |
120 return false; | 120 return false; |
121 | 121 |
122 AudioNodeOutput* output = this->output(outputIndex); | 122 AudioNodeOutput* output = this->output(outputIndex); |
123 if (!destination) { | 123 if (!destination) { |
124 // Disconnect output from any inputs it may be currently connected to. | 124 // Disconnect output from any inputs it may be currently connected to. |
125 output->disconnectAllInputs(); | 125 output->disconnectAllInputs(); |
126 return true; | 126 return true; |
127 } | 127 } |
| 128 |
| 129 if (context() != destination->context()) |
| 130 return false; |
128 | 131 |
129 AudioNodeInput* input = destination->input(inputIndex); | 132 AudioNodeInput* input = destination->input(inputIndex); |
130 input->connect(output); | 133 input->connect(output); |
131 | 134 |
132 // Let context know that a connection has been made. | 135 // Let context know that a connection has been made. |
133 context()->incrementConnectionCount(); | 136 context()->incrementConnectionCount(); |
134 | 137 |
135 return true; | 138 return true; |
136 } | 139 } |
137 | 140 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 printf("%d: %d\n", i, s_nodeCount[i]); | 316 printf("%d: %d\n", i, s_nodeCount[i]); |
314 | 317 |
315 printf("===========================\n\n\n"); | 318 printf("===========================\n\n\n"); |
316 } | 319 } |
317 | 320 |
318 #endif // DEBUG_AUDIONODE_REFERENCES | 321 #endif // DEBUG_AUDIONODE_REFERENCES |
319 | 322 |
320 } // namespace WebCore | 323 } // namespace WebCore |
321 | 324 |
322 #endif // ENABLE(WEB_AUDIO) | 325 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |