quartz: Fix handling of zero byte samples and endofstreams.