deal with EAGAIN. see ffmpeg(usleep 10000?)