encoder: stop when encoding buffer full. closes #32