- // restart from the beginning
- buffer_->rewind();
- buffer_->stream(buffer);
- alSourceQueueBuffers(source_, 1, &buffer);
+ // reload the same buffer
+ mQueue.push_back(buffer);
+ buffer->rewind();
+ buffer->stream(bufferObj);
+ alSourceQueueBuffers(mSource, 1, &bufferObj);
+ logInfo("looping same buffer");
+ }
+ else
+ {
+ // nothing more to play, stopping...
+ mIsPlaying = false;
+ std::remove(mBuffers.begin(), mBuffers.end(), bufferObj);