'Return the byte position in the file where the time position
is \'pos\' seconds. Return 0 if this is not possible'

def seek(self, end_time):

    if ((not hasattr(self, u'filename')) or (not hasattr(self, u'start'))):
        return 0
    file = open(self.filename)
    seek_to = 0
    while 1:
        file.seek(self.__seek_size__, 1)
        buffer = file.read(self.__sample_size__)
        if (len(buffer) < 10000):
            break
        pos = self.__search__(buffer)
        if (pos != None):
            nt = self.get_time(buffer[pos:])
            if ((nt is not None) and (nt >= end_time)):
                break
        seek_to = file.tell()
    file.close()
    return seek_to
