diff --git a/edosl0util/stream.py b/edosl0util/stream.py index 6111beb01bcdfaf4c412085463ba5b6112c5e9e0..0311c90bfdb5e8913f5575b28c1b0f9c007278ea 100644 --- a/edosl0util/stream.py +++ b/edosl0util/stream.py @@ -13,6 +13,7 @@ from edosl0util.headers import ( ) from edosl0util import headers +from edosl0util.timecode import dt_to_cds LOG = logging.getLogger(__name__) @@ -262,6 +263,7 @@ class PacketStream(object): Seek forward such that the next packet provided will be the first packet having a timestamp available in the secondary header >= stamp and apid. """ + target_tc = dt_to_cds(stamp) # seek past partial groups packet = self.next() while not packet.cds_timecode: @@ -269,7 +271,7 @@ class PacketStream(object): # seek to first packet => `stamp` current_tc = packet.cds_timecode - while current_tc < stamp: + while current_tc < target_tc: packet = self.next() current_tc = packet.cds_timecode or current_tc