From 32dc8d9fcb687e255a5c425efc8c02255be59232 Mon Sep 17 00:00:00 2001 From: On Freund Date: Mon, 26 Feb 2024 22:30:35 +0200 Subject: [PATCH] Improve code comment for Chrome frame bug in Camera (#111504) --- homeassistant/components/camera/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/camera/__init__.py b/homeassistant/components/camera/__init__.py index 1abf1768fa3..5ac981e9d93 100644 --- a/homeassistant/components/camera/__init__.py +++ b/homeassistant/components/camera/__init__.py @@ -300,8 +300,12 @@ async def async_get_still_stream( if img_bytes != last_image: await write_to_mjpeg_stream(img_bytes) - # Chrome seems to always ignore first picture, - # print it twice. + # Chrome always shows the n-1 frame: + # https://issues.chromium.org/issues/41199053 + # https://issues.chromium.org/issues/40791855 + # We send the first frame twice to ensure it shows + # Subsequent frames are not a concern at reasonable frame rates + # (even 1/10 FPS is about the latency of HLS) if last_image is None: await write_to_mjpeg_stream(img_bytes) last_image = img_bytes