def _find_timer_PES_(self, buffer):
        """
        Return position of timer in buffer or -1 if not found.
        This function is valid for PES files
        """
        pos = buffer.find('\x00\x00\x01')
        offset = 0
        if pos == -1 or offset + 1000 >= len(buffer):
            return None

        retpos = -1
        ackcount = 0
        while offset + 1000 < len(buffer):
            pos, timestamp = self.ReadPESHeader(offset, buffer[offset:])
            if timestamp is not None and retpos == -1:
                retpos = offset + timestamp
            if pos == 0:
                # Oops, that was a mpeg header, no PES header
                offset += buffer[offset:].find('\x00\x00\x01')
                retpos = -1
                ackcount = 0
            else:
                offset += pos
                if retpos != -1:
                    ackcount += 1
            if ackcount > 10:
                # looks ok to me
                return retpos
        return None