From 596b62b37e0b1efdaaaa559e181de638f943d877 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 14 Jul 2016 14:22:05 +0000 Subject: [PATCH] Fix a defect that could cause mis-naming a .wav file in fast modes. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6914 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index a67a950cd..580818eba 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1282,7 +1282,9 @@ void MainWindow::fastSink(qint64 frames) } if(!m_diskData) { // Always save; may delete later QDateTime now {QDateTime::currentDateTimeUtc()}; - auto const& period_start = now.addSecs (-now.time ().second () % m_TRperiod); + int n=now.time().second() % m_TRperiod; + if(n<(m_TRperiod/2)) n=n+m_TRperiod; + auto const& period_start = now.addSecs (-n); m_fnameWE = m_config.save_directory ().absoluteFilePath (period_start.toString ("yyMMdd_hhmmss")); m_fileToSave.clear (); // the following is potential a threading hazard - not a good