Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!7Fix: correctly handle buffering of filter computations (not relying on parent stream buffered data)
Pipeline #42490 failed
......@@ -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
################################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment