Przeglądaj źródła

win-capture: Always reset timeout when searching for target display

If the display wasn't found, the timer was not reset, causing the code
to execute on every single tick, stalling the graphics thread and using
excessive CPU.
Richard Stanway 2 lat temu
rodzic
commit
20d4bab77a

+ 4 - 4
plugins/win-capture/duplicator-monitor-capture.c

@@ -526,9 +526,9 @@ static void duplicator_capture_tick(void *data, float seconds)
 									capture->handle);
 									capture->handle);
 						}
 						}
 					}
 					}
-
-					capture->reset_timeout = 0.0f;
 				}
 				}
+
+				capture->reset_timeout = 0.0f;
 			}
 			}
 		}
 		}
 	} else {
 	} else {
@@ -563,10 +563,10 @@ static void duplicator_capture_tick(void *data, float seconds)
 						capture->duplicator =
 						capture->duplicator =
 							gs_duplicator_create(
 							gs_duplicator_create(
 								dxgi_index);
 								dxgi_index);
-
-						capture->reset_timeout = 0.0f;
 					}
 					}
 				}
 				}
+
+				capture->reset_timeout = 0.0f;
 			}
 			}
 		}
 		}