mirror of https://github.com/jetkvm/kvm.git
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:
parent
aa0fe18b4a
commit
7580d00d2b
|
|
@ -769,20 +769,19 @@ 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)
|
|
||||||
{
|
|
||||||
log_info("will not restart video streaming because it's stopped");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (streaming_status == 2) {
|
if (streaming_status == 0 && !detected_signal) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (streaming_status != 0) {
|
||||||
video_stop_streaming();
|
video_stop_streaming();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wait_for_streaming_stopped()) {
|
if (!wait_for_streaming_stopped()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
video_start_streaming();
|
video_start_streaming();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue