diff --git a/plugins/channeltx/moddatv/tsgenerator.cpp b/plugins/channeltx/moddatv/tsgenerator.cpp
index 40a607184..02a6faf45 100644
--- a/plugins/channeltx/moddatv/tsgenerator.cpp
+++ b/plugins/channeltx/moddatv/tsgenerator.cpp
@@ -1,3 +1,20 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2026 Edouard Griffiths, F4EXB. //
+// //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation as version 3 of the License, or //
+// (at your option) any later version. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License V3 for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program. If not, see . //
+///////////////////////////////////////////////////////////////////////////////////
+
extern "C"
{
#include "libavcodec/avcodec.h"
@@ -166,7 +183,8 @@ AVFrame* TSGenerator::load_image_to_yuv_with_opencv(const char* filename, int wi
auto now = std::chrono::system_clock::now();
auto time_t = std::chrono::system_clock::to_time_t(now);
char time_str[32];
- std::strftime(time_str, sizeof(time_str), "%H:%M:%S", std::localtime(&time_t));
+ struct tm time_buffer; // Your own buffer
+ std::strftime(time_str, sizeof(time_str), "%H:%M:%S", localtime_r(&time_t, &time_buffer));
// Draw black background box first
cv::rectangle(rgb_image, cv::Point(15, 28), cv::Point(170, 65),
diff --git a/plugins/channeltx/moddatv/tsgenerator.h b/plugins/channeltx/moddatv/tsgenerator.h
index 0c398ef46..f17782a43 100644
--- a/plugins/channeltx/moddatv/tsgenerator.h
+++ b/plugins/channeltx/moddatv/tsgenerator.h
@@ -1,3 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2019 Edouard Griffiths, F4EXB. //
+// Copyright (C) 2021 Jon Beniston, M7RCE //
+// //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation as version 3 of the License, or //
+// (at your option) any later version. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License V3 for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program. If not, see . //
+///////////////////////////////////////////////////////////////////////////////////
+
+#ifndef INCLUDE_ATVMOD_TSGENERATOR_H
+#define INCLUDE_ATVMOD_TSGENERATOR_H
+
#include
#include
#include
@@ -52,3 +73,5 @@ private:
static double get_dvbs2_rate(double symbol_rate, DATVModSettings::DATVModulation modulation, DATVModSettings::DATVCodeRate code_rate);
static double calc_dvbs2_rate(double symbol_rate, double bits, double fec_num, double fec_den, double bch, double pilots);
};
+
+#endif // INCLUDE_ATVMOD_TSGENERATOR_H