mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-20 09:29:44 +00:00
Merge branch 'main' into release-0.32
Some checks are pending
Some checks are pending
This commit is contained in:
commit
92f8acd41a
2 changed files with 8 additions and 6 deletions
|
|
@ -275,8 +275,7 @@ void ALStream::update(double delta) {
|
|||
unqueueBuffers(alsource);
|
||||
uint preloaded = enqueueBuffers(alsource);
|
||||
|
||||
// alspeaker->stopped is assigned to false at ALSpeaker::play(...)
|
||||
if (speaker->isStopped() && !alspeaker->manuallyStopped) { //TODO: -V560 false-positive?
|
||||
if (speaker->isStopped()) {
|
||||
if (preloaded) {
|
||||
speaker->play();
|
||||
} else if (isStopOnEnd()){
|
||||
|
|
|
|||
|
|
@ -349,7 +349,8 @@ void remove_lower_priority_speaker(int priority) {
|
|||
for (auto it = speakers.begin(); it != speakers.end();) {
|
||||
if (it->second->getPriority() < priority && it->second->isPaused()) {
|
||||
it->second->stop();
|
||||
it = speakers.erase(it);
|
||||
streams.erase(it->first);
|
||||
speakers.erase(it);
|
||||
return;
|
||||
}
|
||||
it++;
|
||||
|
|
@ -357,7 +358,8 @@ void remove_lower_priority_speaker(int priority) {
|
|||
for (auto it = speakers.begin(); it != speakers.end();) {
|
||||
if (it->second->getPriority() < priority) {
|
||||
it->second->stop();
|
||||
it = speakers.erase(it);
|
||||
streams.erase(it->first);
|
||||
speakers.erase(it);
|
||||
return;
|
||||
}
|
||||
it++;
|
||||
|
|
@ -445,6 +447,7 @@ speakerid_t audio::play_stream(
|
|||
int channel
|
||||
) {
|
||||
std::shared_ptr<Stream> stream(open_stream(file, false));
|
||||
stream->setStopOnEnd(true);
|
||||
return play(stream, position, relative, volume, pitch, loop, channel);
|
||||
}
|
||||
|
||||
|
|
@ -520,8 +523,8 @@ void audio::update(double delta) {
|
|||
if (speaker->isStopped()) {
|
||||
auto foundStream = streams.find(it->first);
|
||||
if (foundStream == streams.end() ||
|
||||
(!speaker->isManuallyStopped() &&
|
||||
foundStream->second->isStopOnEnd())) {
|
||||
speaker->isManuallyStopped() ||
|
||||
foundStream->second->isStopOnEnd()) {
|
||||
streams.erase(it->first);
|
||||
it = speakers.erase(it);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue