| 291 | } |
| 292 | |
| 293 | float * |
| 294 | AudioBufferList::next(void) |
| 295 | { |
| 296 | QMutexLocker(&this->listMutex); |
| 297 | |
| 298 | if (this->playBuffer != nullptr) { |
| 299 | std::cerr << "Invalid next(), please call release() first!" << std::endl; |
| 300 | return nullptr; |
| 301 | } else if (this->playListTail == nullptr) { |
| 302 | // Starving |
| 303 | return nullptr; |
| 304 | } else { |
| 305 | AudioBuffer *buffer = this->playListTail; |
| 306 | this->playBuffer = buffer; |
| 307 | |
| 308 | this->playListTail = buffer->prev; |
| 309 | |
| 310 | if (this->playListTail == nullptr) |
| 311 | this->playListHead = nullptr; |
| 312 | --this->playListLen; |
| 313 | |
| 314 | return buffer->data; |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | void |
| 319 | AudioBufferList::release(void) |