REALLY fix stopping sources

This commit is contained in:
Bart van Strien
2011-08-08 16:26:38 +02:00
parent 0b0d8fe3e5
commit c47a7c563b
3 changed files with 15 additions and 1 deletions
+7
View File
@@ -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);
+1
View File
@@ -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);
+7 -1
View File
@@ -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)