Whether to write a sample or not was based on the timestamp of the previous sample, rather than the current sample. PiperOrigin-RevId: 500195279