push the # of frames returned by period size each loop instead of a hardcoded buffer. fix potential memory leak.