| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 m_buffer = buffer; | 376 m_buffer = buffer; |
| 377 } | 377 } |
| 378 | 378 |
| 379 unsigned AudioBufferSourceNode::numberOfChannels() | 379 unsigned AudioBufferSourceNode::numberOfChannels() |
| 380 { | 380 { |
| 381 return output(0)->numberOfChannels(); | 381 return output(0)->numberOfChannels(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 void AudioBufferSourceNode::start(double when) | 384 void AudioBufferSourceNode::start(double when) |
| 385 { | 385 { |
| 386 startPlaying(false, when, 0, buffer()->duration()); | 386 startPlaying(false, when, 0, buffer() ? buffer()->duration() : 0); |
| 387 } | 387 } |
| 388 | 388 |
| 389 void AudioBufferSourceNode::start(double when, double grainOffset) | 389 void AudioBufferSourceNode::start(double when, double grainOffset) |
| 390 { | 390 { |
| 391 startPlaying(true, when, grainOffset, buffer()->duration()); | 391 startPlaying(true, when, grainOffset, buffer() ? buffer()->duration() : 0); |
| 392 } | 392 } |
| 393 | 393 |
| 394 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
uration) | 394 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD
uration) |
| 395 { | 395 { |
| 396 startPlaying(true, when, grainOffset, grainDuration); | 396 startPlaying(true, when, grainOffset, grainDuration); |
| 397 } | 397 } |
| 398 | 398 |
| 399 void AudioBufferSourceNode::startPlaying(bool isGrain, double when, double grain
Offset, double grainDuration) | 399 void AudioBufferSourceNode::startPlaying(bool isGrain, double when, double grain
Offset, double grainDuration) |
| 400 { | 400 { |
| 401 ASSERT(isMainThread()); | 401 ASSERT(isMainThread()); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 void AudioBufferSourceNode::finish() | 505 void AudioBufferSourceNode::finish() |
| 506 { | 506 { |
| 507 clearPannerNode(); | 507 clearPannerNode(); |
| 508 ASSERT(!m_pannerNode); | 508 ASSERT(!m_pannerNode); |
| 509 AudioScheduledSourceNode::finish(); | 509 AudioScheduledSourceNode::finish(); |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace WebCore | 512 } // namespace WebCore |
| 513 | 513 |
| 514 #endif // ENABLE(WEB_AUDIO) | 514 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |