mirror of
https://github.com/love2d/love.git
synced 2026-08-21 13:09:56 +02:00
Fix love.audio.play(staticsources) when the sources have been paused. Resolves issue #1363.
This commit is contained in:
@@ -1000,11 +1000,19 @@ bool Source::play(const std::vector<love::audio::Source*> &sources)
|
|||||||
toPlay.reserve(sources.size());
|
toPlay.reserve(sources.size());
|
||||||
for (size_t i = 0; i < sources.size(); i++)
|
for (size_t i = 0; i < sources.size(); i++)
|
||||||
{
|
{
|
||||||
if (wasPlaying[i])
|
// If the source was paused, wasPlaying[i] will be true but we still
|
||||||
|
// want to resume it. We don't want to call alSourcePlay on sources
|
||||||
|
// that are actually playing though.
|
||||||
|
if (wasPlaying[i] && sources[i]->isPlaying())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (!wasPlaying[i])
|
||||||
|
{
|
||||||
Source *source = (Source*) sources[i];
|
Source *source = (Source*) sources[i];
|
||||||
source->source = ids[i];
|
source->source = ids[i];
|
||||||
source->prepareAtomic();
|
source->prepareAtomic();
|
||||||
|
}
|
||||||
|
|
||||||
toPlay.push_back(ids[i]);
|
toPlay.push_back(ids[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user