Bump pyAV and close unclosed outputs (#35960)

* bump pyAV and close unclosed outputs

* skip stream from coverage for now

* fix divide by zero error
This commit is contained in:
Jason Hunter authored and GitHub committed 2020-05-22 18:13:37 +02:00
1 parent be416d9fc6
commit 8cd905487e
6 files changed
+12 -4

No files matched your search

+4 -1
View File
@@ -79,8 +79,11 @@ class StreamOutput:
@property
def target_duration(self) -> int:
"""Return the average duration of the segments in seconds."""
segment_length = len(self._segments)
if not segment_length:
return 0
durations = [s.duration for s in self._segments]
return round(sum(durations) // len(self._segments)) or 1
return round(sum(durations) // segment_length) or 1
def get_segment(self, sequence: int = None) -> Any:
"""Retrieve a specific segment, or the whole list."""