mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-25 08:36:14 +00:00
Changed: Alternative code for play function for streaming source
This commit is contained in:
parent
6512526d95
commit
29170e6899
1 changed files with 19 additions and 0 deletions
|
@ -249,11 +249,30 @@ bool CSourceAL::play()
|
|||
else if (_IsStreaming)
|
||||
{
|
||||
_IsPaused = false;
|
||||
/* NEW */
|
||||
// called by user as well as by code to resume after buffer underrun
|
||||
if (!_IsPlaying) // set start time if not playing yet
|
||||
_StartTime = CTime::getLocalTime();
|
||||
_IsPlaying = true; // this play always virtually succeed but may not actually be playing
|
||||
if (_QueuedBuffers.size()) // ensure buffers have actually queued
|
||||
{
|
||||
alSourcePlay(_Source);
|
||||
if (alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
nlwarning("AL: Unknown error while trying to play streaming source.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nlwarning("AL: Trying to play stream with no buffers queued.");
|
||||
}
|
||||
/* OLD
|
||||
alSourcePlay(_Source);
|
||||
_IsPlaying = (alGetError() == AL_NO_ERROR);
|
||||
if (_IsPlaying)
|
||||
_StartTime = CTime::getLocalTime(); // TODO: Played time should freeze when buffering fails, and be calculated based on the number of buffers played plus passed time. This is necessary for synchronizing animation with sound.
|
||||
return _IsPlaying;
|
||||
*/
|
||||
// Streaming mode
|
||||
//nlwarning("AL: Cannot play null buffer; streaming not implemented" );
|
||||
//nlstop;
|
||||
|
|
Loading…
Reference in a new issue