From 30cadf59034644ef33ed80da31b7a70c32ccc6c8 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 11 Dec 2019 15:44:27 +0100 Subject: [PATCH] vmount: properly initialize last_active If last_active is initialized at 0 it means that input via mavlink is already enabled but that's generally not the case. --- src/modules/vmount/vmount.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/vmount/vmount.cpp b/src/modules/vmount/vmount.cpp index bc3cd63da4..ee23062cef 100644 --- a/src/modules/vmount/vmount.cpp +++ b/src/modules/vmount/vmount.cpp @@ -220,7 +220,7 @@ static int vmount_thread_main(int argc, char *argv[]) ControlData *control_data = nullptr; g_thread_data = &thread_data; - int last_active = 0; + int last_active = -1; while (!thread_should_exit) { @@ -395,7 +395,7 @@ static int vmount_thread_main(int argc, char *argv[]) thread_data.input_objs_len = 0; - last_active = 0; + last_active = -1; if (thread_data.output_obj) { delete (thread_data.output_obj);