mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Unbuffer when rewinding streaming sources (bug #250)
This commit is contained in:
@@ -265,11 +265,14 @@ namespace openal
|
|||||||
}
|
}
|
||||||
if (type == TYPE_STREAM)
|
if (type == TYPE_STREAM)
|
||||||
{
|
{
|
||||||
|
bool waspaused = paused;
|
||||||
// Because we still have old data
|
// Because we still have old data
|
||||||
// from before the seek in the buffers
|
// from before the seek in the buffers
|
||||||
// let's empty them.
|
// let's empty them.
|
||||||
stopAtomic(false);
|
stopAtomic(false);
|
||||||
playAtomic();
|
playAtomic();
|
||||||
|
if (waspaused)
|
||||||
|
pauseAtomic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -462,7 +465,15 @@ namespace openal
|
|||||||
}
|
}
|
||||||
else if(valid && type == TYPE_STREAM)
|
else if(valid && type == TYPE_STREAM)
|
||||||
{
|
{
|
||||||
|
bool waspaused = paused;
|
||||||
decoder->rewind();
|
decoder->rewind();
|
||||||
|
// Because we still have old data
|
||||||
|
// from before the seek in the buffers
|
||||||
|
// let's empty them.
|
||||||
|
stopAtomic(false);
|
||||||
|
playAtomic();
|
||||||
|
if (waspaused)
|
||||||
|
pauseAtomic();
|
||||||
offsetSamples = 0;
|
offsetSamples = 0;
|
||||||
offsetSeconds = 0;
|
offsetSeconds = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user