PTS offset of samples was not properly considered, and sleep between samples was PTS-based instead of being DTS-based.