rc = 0; do { int read; char *data; read = bufgetdata(ev.data,CODEC_SIZE-rc, &codecbuf[rc]); DEBUGF("%d %d\n", rc, read); if (read == -2) yield(); else rc += read; } while (read != 0);