| 333 | } |
| 334 | |
| 335 | void |
| 336 | AudioBufferList::clear(void) |
| 337 | { |
| 338 | QMutexLocker(&this->listMutex); |
| 339 | |
| 340 | // You cannot commit if the current buffer is null |
| 341 | if (this->current != nullptr) { |
| 342 | AudioBuffer *buffer = this->current; |
| 343 | this->current = nullptr; |
| 344 | |
| 345 | buffer->prev = nullptr; |
| 346 | buffer->next = this->playListHead; |
| 347 | if (this->playListHead != nullptr) |
| 348 | this->playListHead->prev = buffer; |
| 349 | |
| 350 | this->playListHead = buffer; |
| 351 | |
| 352 | if (this->playListTail == nullptr) |
| 353 | this->playListTail = buffer; |
| 354 | ++this->playListLen; |
| 355 | } |
| 356 | |
| 357 | while (next()) |
| 358 | release(); |
| 359 | } |
| 360 | |
| 361 | //////////////////////////////// AudioBuffer /////////////////////////////////// |
| 362 | AudioPlayback::AudioPlayback(std::string const &dev, unsigned int rate) |