Commit f2cdc116 authored by Vincent POLLET's avatar Vincent POLLET
Browse files

Fix: correctly handle buffering of filter computations (not relying on parent stream buffered data)

parent 005f889d
Pipeline #42490 failed with stage
in 4 minutes and 34 seconds
......@@ -249,7 +249,8 @@ def stream_filter(name):
class StreamFilter(Stream):
def __init__(self, name, parent):
super().__init__(name=name, parent=parent)
pass
self.__loaded = None
self.__data = None
def get_frame_indices(self, index):
return super().get_frame_indices(index)
......@@ -264,15 +265,13 @@ class StreamFilter(Stream):
# load one or several frames
def load(self, index=None):
indices = self.get_frame_indices(index)
# return buffered data OR load from file OR process data
if self._Stream__loaded == indices and self._Stream__data is not None:
# print('loaded', self.name)
# if data is buffered, do not do processing again !
if self.__loaded == indices and self.__data is not None:
pass
else:
self.__data = self.process(self.parent.load(indices), indices)
self.__loaded = indices
# buffer and return data
self.__loaded = indices
return self.__data
################################################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment