win-capture: Clarify if statement via inline func

Clears up a warning (to prevent && and || confusion), and clarifies what
specifically the if statement is trying to accomplish (check to see if
the capture is valid)
This commit is contained in:
jp9000
2015-02-08 16:07:48 -08:00
parent e2ee8adf77
commit 2301a6f578

View File

@@ -943,6 +943,14 @@ static bool start_capture(struct game_capture *gc)
return true;
}
static inline bool capture_valid(struct game_capture *gc)
{
if (!gc->dwm_capture && !IsWindow(gc->window))
return false;
return !object_signalled(gc->target_process);
}
static void game_capture_tick(void *data, float seconds)
{
struct game_capture *gc = data;
@@ -992,8 +1000,7 @@ static void game_capture_tick(void *data, float seconds)
}
}
} else {
if (!IsWindow(gc->window) && !gc->dwm_capture ||
object_signalled(gc->target_process)) {
if (!capture_valid(gc)) {
info("capture window no longer exists, "
"terminating capture");
stop_capture(gc);