| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 void AudioScheduledSourceHandler::updateSchedulingInfo( | 48 void AudioScheduledSourceHandler::updateSchedulingInfo( |
| 49 size_t quantumFrameSize, | 49 size_t quantumFrameSize, |
| 50 AudioBus* outputBus, | 50 AudioBus* outputBus, |
| 51 size_t& quantumFrameOffset, | 51 size_t& quantumFrameOffset, |
| 52 size_t& nonSilentFramesToProcess) { | 52 size_t& nonSilentFramesToProcess) { |
| 53 DCHECK(outputBus); | 53 DCHECK(outputBus); |
| 54 if (!outputBus) | 54 if (!outputBus) |
| 55 return; | 55 return; |
| 56 | 56 |
| 57 DCHECK_EQ(quantumFrameSize, static_cast<size_t>(ProcessingSizeInFrames)); | 57 DCHECK_EQ(quantumFrameSize, |
| 58 if (quantumFrameSize != ProcessingSizeInFrames) | 58 static_cast<size_t>(AudioUtilities::kRenderQuantumFrames)); |
| 59 if (quantumFrameSize != AudioUtilities::kRenderQuantumFrames) |
| 59 return; | 60 return; |
| 60 | 61 |
| 61 double sampleRate = this->sampleRate(); | 62 double sampleRate = this->sampleRate(); |
| 62 | 63 |
| 63 // quantumStartFrame : Start frame of the current time quantum. | 64 // quantumStartFrame : Start frame of the current time quantum. |
| 64 // quantumEndFrame : End frame of the current time quantum. | 65 // quantumEndFrame : End frame of the current time quantum. |
| 65 // startFrame : Start frame for this source. | 66 // startFrame : Start frame for this source. |
| 66 // endFrame : End frame for this source. | 67 // endFrame : End frame for this source. |
| 67 size_t quantumStartFrame = context()->currentSampleFrame(); | 68 size_t quantumStartFrame = context()->currentSampleFrame(); |
| 68 size_t quantumEndFrame = quantumStartFrame + quantumFrameSize; | 69 size_t quantumEndFrame = quantumStartFrame + quantumFrameSize; |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // playback state if the context is closed. | 274 // playback state if the context is closed. |
| 274 if (context()->isContextClosed()) | 275 if (context()->isContextClosed()) |
| 275 return false; | 276 return false; |
| 276 | 277 |
| 277 // If a node is scheduled or playing, do not collect the node prematurely | 278 // If a node is scheduled or playing, do not collect the node prematurely |
| 278 // even its reference is out of scope. Then fire onended event if assigned. | 279 // even its reference is out of scope. Then fire onended event if assigned. |
| 279 return audioScheduledSourceHandler().isPlayingOrScheduled(); | 280 return audioScheduledSourceHandler().isPlayingOrScheduled(); |
| 280 } | 281 } |
| 281 | 282 |
| 282 } // namespace blink | 283 } // namespace blink |
| OLD | NEW |