mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-22 18:39:46 +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);
|
unqueueBuffers(alsource);
|
||||||
uint preloaded = enqueueBuffers(alsource);
|
uint preloaded = enqueueBuffers(alsource);
|
||||||
|
|
||||||
// alspeaker->stopped is assigned to false at ALSpeaker::play(...)
|
if (speaker->isStopped()) {
|
||||||
if (speaker->isStopped() && !alspeaker->manuallyStopped) { //TODO: -V560 false-positive?
|
|
||||||
if (preloaded) {
|
if (preloaded) {
|
||||||
speaker->play();
|
speaker->play();
|
||||||
} else if (isStopOnEnd()){
|
} else if (isStopOnEnd()){
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,8 @@ void remove_lower_priority_speaker(int priority) {
|
||||||
for (auto it = speakers.begin(); it != speakers.end();) {
|
for (auto it = speakers.begin(); it != speakers.end();) {
|
||||||
if (it->second->getPriority() < priority && it->second->isPaused()) {
|
if (it->second->getPriority() < priority && it->second->isPaused()) {
|
||||||
it->second->stop();
|
it->second->stop();
|
||||||
it = speakers.erase(it);
|
streams.erase(it->first);
|
||||||
|
speakers.erase(it);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
it++;
|
it++;
|
||||||
|
|
@ -357,7 +358,8 @@ void remove_lower_priority_speaker(int priority) {
|
||||||
for (auto it = speakers.begin(); it != speakers.end();) {
|
for (auto it = speakers.begin(); it != speakers.end();) {
|
||||||
if (it->second->getPriority() < priority) {
|
if (it->second->getPriority() < priority) {
|
||||||
it->second->stop();
|
it->second->stop();
|
||||||
it = speakers.erase(it);
|
streams.erase(it->first);
|
||||||
|
speakers.erase(it);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
it++;
|
it++;
|
||||||
|
|
@ -445,6 +447,7 @@ speakerid_t audio::play_stream(
|
||||||
int channel
|
int channel
|
||||||
) {
|
) {
|
||||||
std::shared_ptr<Stream> stream(open_stream(file, false));
|
std::shared_ptr<Stream> stream(open_stream(file, false));
|
||||||
|
stream->setStopOnEnd(true);
|
||||||
return play(stream, position, relative, volume, pitch, loop, channel);
|
return play(stream, position, relative, volume, pitch, loop, channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -520,8 +523,8 @@ void audio::update(double delta) {
|
||||||
if (speaker->isStopped()) {
|
if (speaker->isStopped()) {
|
||||||
auto foundStream = streams.find(it->first);
|
auto foundStream = streams.find(it->first);
|
||||||
if (foundStream == streams.end() ||
|
if (foundStream == streams.end() ||
|
||||||
(!speaker->isManuallyStopped() &&
|
speaker->isManuallyStopped() ||
|
||||||
foundStream->second->isStopOnEnd())) {
|
foundStream->second->isStopOnEnd()) {
|
||||||
streams.erase(it->first);
|
streams.erase(it->first);
|
||||||
it = speakers.erase(it);
|
it = speakers.erase(it);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue