summaryrefslogtreecommitdiffstats
path: root/src/sound/oalsound/channel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sound/oalsound/channel.cpp')
-rw-r--r--src/sound/oalsound/channel.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sound/oalsound/channel.cpp b/src/sound/oalsound/channel.cpp
index 83420ea..2b9af9b 100644
--- a/src/sound/oalsound/channel.cpp
+++ b/src/sound/oalsound/channel.cpp
@@ -54,7 +54,7 @@ Channel::~Channel() {
bool Channel::Play() {
if (!mReady || mBuffer == nullptr)
return false;
-
+
alSourcei(mSource, AL_LOOPING, static_cast<ALint>(mLoop));
alSourcePlay(mSource);
if (alCheck())
@@ -223,7 +223,8 @@ Sound Channel::GetSoundType() {
bool Channel::SetBuffer(Buffer *buffer) {
if (!mReady)
return false;
-
+
+ Stop();
mBuffer = buffer;
if (buffer == nullptr) {
alSourcei(mSource, AL_BUFFER, 0);
@@ -276,7 +277,7 @@ bool Channel::IsReady() {
}
bool Channel::IsLoaded() {
- return mBuffer == nullptr;
+ return mBuffer != nullptr;
}