'Return position of timer in buffer or -1 if not found.
This function is valid for PES files'

def _find_timer_PES_(self, buffer):

    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 != None) and (retpos == (-1))):
            retpos = (offset + timestamp)
        if (pos == 0):
            offset += buffer[offset:].find('\x00\x00\x01')
            retpos = (-1)
            ackcount = 0
        else:
            offset += pos
            if (retpos != (-1)):
                ackcount += 1
        if (ackcount > 10):
            return retpos
    return None
