Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ omit =
homeassistant/components/steam_online/sensor.py
homeassistant/components/stiebel_eltron/*
homeassistant/components/stookalert/*
homeassistant/components/stream/*
homeassistant/components/streamlabswater/*
homeassistant/components/suez_water/*
homeassistant/components/supervisord/sensor.py
Expand Down
5 changes: 4 additions & 1 deletion homeassistant/components/stream/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@ def segments(self) -> List[int]:
@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."""
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/stream/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "stream",
"name": "Stream",
"documentation": "https://www.home-assistant.io/integrations/stream",
"requirements": ["av==7.0.1"],
"requirements": ["av==8.0.1"],
"dependencies": ["http"],
"codeowners": ["@hunterjm"],
"quality_scale": "internal"
Expand Down
4 changes: 4 additions & 0 deletions homeassistant/components/stream/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,7 @@ def stream_worker(hass, stream, quit_event):
# Assign the video packet to the new stream & mux
packet.stream = buffer.vstream
buffer.output.mux(packet)

# Close stream
buffer.output.close()
Comment thread
hunterjm marked this conversation as resolved.
container.close()
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ atenpdu==0.3.0
aurorapy==0.2.6

# homeassistant.components.stream
av==7.0.1
av==8.0.1

# homeassistant.components.avea
avea==1.4
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ arcam-fmj==0.4.6
async-upnp-client==0.14.13

# homeassistant.components.stream
av==7.0.1
av==8.0.1

# homeassistant.components.axis
axis==26
Expand Down