Skip to content
Snippets Groups Projects
Commit d72adb41 authored by Bruce Flynn's avatar Bruce Flynn
Browse files

potential fix for seek_to

parent 7f441802
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment