diff --git a/src/livepeer_gateway/media_output.py b/src/livepeer_gateway/media_output.py index f21d385..a5aa924 100644 --- a/src/livepeer_gateway/media_output.py +++ b/src/livepeer_gateway/media_output.py @@ -12,6 +12,8 @@ from contextlib import suppress from typing import AsyncIterator, Collection, Optional +import aiohttp + from .errors import LivepeerGatewayError from .media_decode import ( AudioDecodedMediaFrame, @@ -237,7 +239,7 @@ async def _feed() -> None: decoder.stop() if not producer_task.done(): producer_task.cancel() - with suppress(asyncio.CancelledError): + with suppress(asyncio.CancelledError, aiohttp.ClientConnectionError): await producer_task await asyncio.to_thread(decoder.join) self._last_decoder_stats = decoder.get_stats()