[sdlsound] Unclear on SDL_Sound SOUND_SAMPLEFLAG_EAGAIN
gtoombs at lakeheadu.ca
Tue Jan 7 00:01:08 EST 2014
Ok. So does that mean that, if a subsequent decode succeeds, it's safe to use the whole buffer? In other words, if I see EAGAIN, how do I interpret the returned byte count?
-------- Original message --------
From: "Ryan C. Gordon" <icculus at icculus.org>
Date: 2014/01/06 23:16 (GMT-05:00)
To: SDL_sound mailing list <sdlsound at icculus.org>
Subject: Re: [sdlsound] Unclear on SDL_Sound SOUND_SAMPLEFLAG_EAGAIN
On 01/05/2014 10:11 PM, Greg Toombs wrote:
> I'm cross-posting this to Stack Overflow -
> I briefly perused the source code for SDL_Sound but, as with the above
> post, I'm still not sure what the flag means. Any clarification would be
> appreciated. Thanks folks.
It means try to decode again, it was probably a temporary problem.
For example, if you have a RWops that's pulling audio data from a web
server, and SDL_sound has decoded all the data available and is waiting
for more to come over the network, EAGAIN might get set.
If that web server unexpectedly drops the connection halfway through,
that won't report EAGAIN. That reports SOUND_SAMPLEFLAG_ERROR.
SOUND_SAMPLEFLAG_EAGAIN means we just couldn't finish the operation
right now, so we gave control back to your app instead of waiting until
sdlsound mailing list
sdlsound at icculus.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the sdlsound