

def _cut_frames_flagmask(self):
    offset = self._s.data_offset
    target_pos = (len(self._s.data) - self._buffer_frames)
    if (target_pos < 1):
        return
    (i_pos, i_len) = (0, len(self._index))
    target_pos += offset
    while (i_pos < i_len):
        (abs_pos, grpos) = self._index[i_pos]
        if (abs_pos > target_pos):
            break
        i_pos += 1
    if (i_pos > 0):
        i_pos -= 1
        (pos, self._index[:i_pos]) = ((self._index[i_pos][0] - offset), [])
        d = self._s.data
        (self._s.data_offset, d[:pos]) = ((offset + pos), [])
        self._grpos_first = d[0][0]

dataset/ETHPy150Open arkadini/twimp/twimp/server/inmemory.py IMLiveStream._cut_frames_flagmask/original