From 8851cec1cca708eea07448efbdf16bdf8e732f12 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Mon, 12 May 2014 20:30:00 +0300 Subject: [PATCH] Fix valgrind warnings in inthread.cpp --- src/core/inthread.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/core/inthread.cpp b/src/core/inthread.cpp index 020bd09d..467b0c2a 100644 --- a/src/core/inthread.cpp +++ b/src/core/inthread.cpp @@ -72,12 +72,22 @@ namespace struct voicesub_state { + voicesub_state() + { + current_time = 0; + time_jump = false; + active_flag = false; + last_frame_number = 0; + last_rate = 0; + current_collection = NULL; + int_task = NULL; + } //Recording active flag. - volatile bool active_flag = false; + volatile bool active_flag; //Last seen frame number. - uint64_t last_frame_number = 0; + uint64_t last_frame_number; //Last seen rate. - double last_rate = 0; + double last_rate; //Mutex protecting current_time and time_jump. threads::lock time_mutex; //The current time. @@ -1455,8 +1465,8 @@ out: void voicesub_state::update_time() { - uint64_t sampletime; - bool jumping; + uint64_t sampletime = 0; + bool jumping = false; { threads::alock m(time_mutex); sampletime = current_time; -- 2.11.4.GIT