[sdlsound] Unclear on SDL_Sound SOUND_SAMPLEFLAG_EAGAIN

Ryan C. Gordon icculus at icculus.org
Mon Jan 6 23:16:11 EST 2014

On 01/05/2014 10:11 PM, Greg Toombs wrote:
> I'm cross-posting this to Stack Overflow -
> http://stackoverflow.com/questions/20942108/sdl-sound-sound-sampleflag-eagain-behaviour
> 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 
we could.


More information about the sdlsound mailing list