Skip to content

Commit 5bd63bb

Browse files
authored
Replace AVError with FFmpegError (#129689)
1 parent f7103da commit 5bd63bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

homeassistant/components/stream/worker.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class StreamWorkerError(Exception):
4747
"""An exception thrown while processing a stream."""
4848

4949

50-
def redact_av_error_string(err: av.AVError) -> str:
50+
def redact_av_error_string(err: av.FFmpegError) -> str:
5151
"""Return an error string with credentials redacted from the url."""
5252
parts = [str(err.type), err.strerror]
5353
if err.filename is not None:
@@ -525,7 +525,7 @@ def stream_worker(
525525
del pyav_options["stimeout"]
526526
try:
527527
container = av.open(source, options=pyav_options, timeout=SOURCE_TIMEOUT)
528-
except av.AVError as err:
528+
except av.FFmpegError as err:
529529
raise StreamWorkerError(
530530
f"Error opening stream ({redact_av_error_string(err)})"
531531
) from err
@@ -599,7 +599,7 @@ def is_video(packet: av.Packet) -> Any:
599599
except StopIteration as ex:
600600
container.close()
601601
raise StreamEndedError("Stream ended; no additional packets") from ex
602-
except av.AVError as ex:
602+
except av.FFmpegError as ex:
603603
container.close()
604604
raise StreamWorkerError(
605605
f"Error demuxing stream while finding first packet ({redact_av_error_string(ex)})"
@@ -626,7 +626,7 @@ def is_video(packet: av.Packet) -> Any:
626626
raise
627627
except StopIteration as ex:
628628
raise StreamEndedError("Stream ended; no additional packets") from ex
629-
except av.AVError as ex:
629+
except av.FFmpegError as ex:
630630
raise StreamWorkerError(
631631
f"Error demuxing stream ({redact_av_error_string(ex)})"
632632
) from ex

0 commit comments

Comments
 (0)