Fix mypy type for timestamp validator (#53598)

This commit is contained in:
Allen Porter 2021-07-27 22:04:59 -07:00 committed by GitHub
parent 85c1614204
commit b3b5ee10b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,7 +117,6 @@ class SegmentBuffer:
# Check for end of segment # Check for end of segment
if packet.stream == self._input_video_stream: if packet.stream == self._input_video_stream:
if ( if (
packet.is_keyframe packet.is_keyframe
and (packet.dts - self._segment_start_dts) * packet.time_base and (packet.dts - self._segment_start_dts) * packet.time_base
@ -253,7 +252,7 @@ class TimestampValidator:
# Number of consecutive missing decompression timestamps # Number of consecutive missing decompression timestamps
self._missing_dts = 0 self._missing_dts = 0
def is_valid(self, packet: av.Packet) -> float: def is_valid(self, packet: av.Packet) -> bool:
"""Validate the packet timestamp based on ordering within the stream.""" """Validate the packet timestamp based on ordering within the stream."""
# Discard packets missing DTS. Terminate if too many are missing. # Discard packets missing DTS. Terminate if too many are missing.
if packet.dts is None: if packet.dts is None: