[sdlsound] Unclear on SDL_Sound SOUND_SAMPLEFLAG_EAGAIN

Greg Toombs 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 -
> 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.

--ryan.


_______________________________________________
sdlsound mailing list
sdlsound at icculus.org
http://icculus.org/mailman/listinfo/sdlsound
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/sdlsound/attachments/20140107/77082bbf/attachment.html>


More information about the sdlsound mailing list