| 266 | } |
| 267 | |
| 268 | void |
| 269 | AudioBufferList::commit(void) |
| 270 | { |
| 271 | QMutexLocker(&this->listMutex); |
| 272 | |
| 273 | // You cannot commit if the current buffer is null |
| 274 | if (this->current == nullptr) { |
| 275 | std::cerr << "Calling commit() with no reserve() is forbidden." << std::endl; |
| 276 | } else { |
| 277 | AudioBuffer *buffer = this->current; |
| 278 | this->current = nullptr; |
| 279 | |
| 280 | buffer->prev = nullptr; |
| 281 | buffer->next = this->playListHead; |
| 282 | if (this->playListHead != nullptr) |
| 283 | this->playListHead->prev = buffer; |
| 284 | |
| 285 | this->playListHead = buffer; |
| 286 | |
| 287 | if (this->playListTail == nullptr) |
| 288 | this->playListTail = buffer; |
| 289 | ++this->playListLen; |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | float * |
| 294 | AudioBufferList::next(void) |