Fix HDMI hotplug video restart after sleep mode changes

The sleep mode feature from dev (PR #999) prevented video from auto-starting
when streaming_status == 0, which broke HDMI hotplug functionality.

Modified video_restart_streaming() to check detected_signal:
- No signal + not streaming -> don't start (preserve sleep mode)
- Has signal -> always stop cleanly then restart (fix hotplug)

This ensures proper encoder cleanup and prevents corrupted video output
after HDMI disconnect/reconnect cycles.
This commit is contained in:
Alex P 2025-11-25 00:04:40 +02:00
parent aa0fe18b4a
commit 7580d00d2b
1 changed files with 6 additions and 7 deletions

View File

@ -769,13 +769,12 @@ uint8_t video_get_streaming_status() {
void video_restart_streaming() void video_restart_streaming()
{ {
uint8_t streaming_status = video_get_streaming_status(); uint8_t streaming_status = video_get_streaming_status();
if (streaming_status == 0)
{ if (streaming_status == 0 && !detected_signal) {
log_info("will not restart video streaming because it's stopped");
return; return;
} }
if (streaming_status == 2) { if (streaming_status != 0) {
video_stop_streaming(); video_stop_streaming();
} }