# some players do not like it when we dont return anything after an error
# so we send some silence so they move on to the next track on their own (hopefully)
async for chunk in get_silence(10, output_format):
- await resp.write(chunk)
+ try:
+ await resp.write(chunk)
+ except (BrokenPipeError, ConnectionResetError, ConnectionError):
+ break
return resp
async def serve_queue_flow_stream(self, request: web.Request) -> web.Response:
buffer = buffer[pcm_format.pcm_sample_size :]
# end of audio/track reached
- if bytes_sent == 0:
- # edge case: no audio data was sent
- raise AudioError("No audio was received")
-
logger.log(VERBOSE_LOG_LEVEL, "End of stream reached.")
if strip_silence_end and buffer:
# strip silence from end of audio
del buffer
# wait until stderr also completed reading
await ffmpeg_proc.wait_with_timeout(5)
+ if bytes_sent == 0:
+ # edge case: no audio data was sent
+ raise AudioError("No audio was received")
finished = True
except (Exception, GeneratorExit) as err:
if isinstance(err, asyncio.CancelledError | GeneratorExit):
"-f",
output_format.content_type.value,
]
- elif input_format == output_format and not extra_args:
+ elif input_format == output_format and not filter_params and not extra_args:
# passthrough-mode (e.g. for creating the cache)
if output_format.content_type in (
ContentType.MP4,