Commit cdc8091c authored by Mikhail Karnevskiy's avatar Mikhail Karnevskiy
Browse files

Fix streaming work

parent 01278fdc
......@@ -13,7 +13,7 @@ def max_substream(substreams):
return max(int(s) for s in substreams if s.isdecimal())
def get_new_substream(substream_list, sender_substream_list):
def get_new_substream(substream_list, sender_substream_list, substream):
if sender_substream_list is None:
return None
new_seubstreams = list(set(substream_list)
......@@ -27,7 +27,9 @@ def get_new_substream(substream_list, sender_substream_list):
def has_newer_substream(substream, substream_list, metadata_substream_list,
sender_substream_list=None):
if sender_substream_list:
return get_new_substream(substream_list, sender_substream_list) is not None
return (get_new_substream(substream_list,
sender_substream_list,
substream) is not None)
else:
# a newer substream is ready, when it has data and metadata
max_substream_number = max_substream(substream_list)
......@@ -130,7 +132,7 @@ class Streamer:
return
try:
sender_substream_list = self.receiver.get_substream_list()
sender_substream_list = self.worker.sender.get_substream_list()
except StreamError:
sender_substream_list = None
......@@ -165,7 +167,8 @@ class Streamer:
if (has_data or newer_has_data) and self.end_of_stream_callback:
# call the callback only once
new_substream = get_new_substream(substream_list, sender_substream_list)
new_substream = get_new_substream(
substream_list, sender_substream_list, self.receiver.substream)
self.end_of_stream_callback(self.receiver.substream, new_substream)
self.end_of_stream_callback = None
......
Supports Markdown
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