<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014/1/7 Ryan C. Gordon <span dir="ltr"><<a href="mailto:icculus@icculus.org" target="_blank">icculus@icculus.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 01/07/2014 12:01 AM, Greg Toombs wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ok. So does that mean that, if a subsequent decode succeeds, it's safe<br>
to use the whole buffer? In other words, if I see EAGAIN, how do I<br>
interpret the returned byte count?<br>
</blockquote>
</div><br>
It's worth noting that this is a lot of explaining for a flag you might not need. Here's what the playsound_simple.c demo app does:<br>
<br>
    /* if there wasn't previously an error or EOF, read more. */<br>
    if ( ((sample->flags & SOUND_SAMPLEFLAG_ERROR) == 0) &&<br>
         ((sample->flags & SOUND_SAMPLEFLAG_EOF) == 0) )<br>
    {<br>
         data->decoded_bytes = Sound_Decode(sample);<br>
         data->decoded_ptr = sample->buffer;<br>
    } /* if */<br>
<br>
It doesn't check EAGAIN...it either got enough data or it didn't, or there's definitely no more data coming or it needs to keep checking.</blockquote><div><br></div><div>Yeah, I also check for EAGAIN only if the returned byte count is 0.</div>
<div><br></div><div>Jonas </div></div></div></div>