mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Fix love.audio.play{sources...} so it can resume paused sources
--HG-- branch : minor
This commit is contained in:
@@ -901,12 +901,17 @@ bool Source::playAtomic(const std::vector<love::audio::Source*> &sources, const
|
||||
toPlay.reserve(sources.size());
|
||||
for (size_t i = 0; i < sources.size(); i++)
|
||||
{
|
||||
Source *source = (Source*) sources[i];
|
||||
// Paused sources have wasPlaying set to true, so do this first
|
||||
if (!source->isPlaying())
|
||||
toPlay.push_back(ids[i]);
|
||||
|
||||
// If it wasn't playing (nor paused), we have just allocated a new
|
||||
// source
|
||||
if (wasPlaying[i])
|
||||
continue;
|
||||
Source *source = (Source*) sources[i];
|
||||
source->source = ids[i];
|
||||
source->prepareAtomic();
|
||||
toPlay.push_back(ids[i]);
|
||||
}
|
||||
|
||||
alGetError();
|
||||
|
||||
Reference in New Issue
Block a user