Skip to content

Commit 40cea52

Browse files
committed
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.
1 parent 3f99e88 commit 40cea52

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

internal/native/cgo/video.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -769,20 +769,19 @@ uint8_t video_get_streaming_status() {
769769
void video_restart_streaming()
770770
{
771771
uint8_t streaming_status = video_get_streaming_status();
772-
if (streaming_status == 0)
773-
{
774-
log_info("will not restart video streaming because it's stopped");
772+
773+
if (streaming_status == 0 && !detected_signal) {
775774
return;
776-
}
775+
}
777776

778-
if (streaming_status == 2) {
777+
if (streaming_status != 0) {
779778
video_stop_streaming();
780779
}
781780

782781
if (!wait_for_streaming_stopped()) {
783782
return;
784783
}
785-
784+
786785
video_start_streaming();
787786
}
788787

0 commit comments

Comments
 (0)