mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
REALLY fix stopping sources
This commit is contained in:
@@ -209,6 +209,13 @@ namespace openal
|
||||
i->first->rewindAtomic();
|
||||
}
|
||||
|
||||
// For those times we don't need it backed.
|
||||
void Pool::softRewind(Source * source)
|
||||
{
|
||||
thread::Lock lock(mutex);
|
||||
source->rewindAtomic();
|
||||
}
|
||||
|
||||
void Pool::rewind(Source * source)
|
||||
{
|
||||
thread::Lock lock(mutex);
|
||||
|
||||
@@ -100,6 +100,7 @@ namespace openal
|
||||
void resume(Source * source);
|
||||
void rewind();
|
||||
void rewind(Source * source);
|
||||
void softRewind(Source * source);
|
||||
void seek(Source * source, float offset, void * unit);
|
||||
float tell(Source * source, void * unit);
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace openal
|
||||
if (!isStopped())
|
||||
{
|
||||
pool->stop(this);
|
||||
rewind();
|
||||
pool->softRewind(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,6 +476,12 @@ namespace openal
|
||||
offsetSamples = 0;
|
||||
offsetSeconds = 0;
|
||||
}
|
||||
else if (type == TYPE_STREAM)
|
||||
{
|
||||
decoder->rewind();
|
||||
offsetSamples = 0;
|
||||
offsetSeconds = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Source::reset(ALenum source)
|
||||
|
||||
Reference in New Issue
Block a user