Skip to content

Commit f2a0ec0

Browse files
committed
Force LC_NUMERIC to C
FFmpeg is locale-dependent and may not parse filter strings correctly in non-English systems. Signed-off-by: Maxime Gervais <[email protected]>
1 parent e2832ad commit f2a0ec0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Source/Cli/cli.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "Core/FileInformation.h"
66
#include <QDir>
77
#include <Core/logging.h>
8+
#include <clocale>
89

910
Cli::Cli() : indexOfStreamWithKnownFrameCount(0), statsFileBytesWritten(0), statsFileBytesTotal(0), statsFileBytesUploaded(0), statsFileBytesToUpload(0)
1011
{
@@ -37,6 +38,7 @@ int Cli::exec(QCoreApplication &a)
3738
bool forceUploadToSignalServer = false;
3839

3940
QString checkUploadFileName;
41+
std::setlocale(LC_NUMERIC, "C");
4042

4143
for(int i = 1; i < a.arguments().length(); ++i)
4244
{

Source/GUI/Plots.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <qwt_plot_layout.h>
2525
#include <qwt_plot_canvas.h>
2626
#include <cmath>
27-
#include <clocale>
2827
#include <unordered_set>
2928
#include <QMouseEvent>
3029
#include <QInputDialog>
@@ -145,7 +144,6 @@ Plots::Plots( QWidget *parent, FileInformation* fileInformation ) :
145144
m_dataTypeIndex( Plots::AxisSeconds ),
146145
m_commentsPlot(nullptr)
147146
{
148-
setlocale(LC_NUMERIC, "C");
149147
QGridLayout* layout = new QGridLayout( this );
150148
layout->setSpacing( 1 );
151149
layout->setContentsMargins( 0, 0, 0, 0 );

Source/GUI/mainwindow.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <QScreen>
3535
#include <QClipboard>
3636
#include <QGuiApplication>
37+
#include <clocale>
3738

3839
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
3940
#include <QDesktopWidget>
@@ -82,6 +83,8 @@ MainWindow::MainWindow(QWidget *parent) :
8283
DragDrop_Image=NULL;
8384
DragDrop_Text=NULL;
8485

86+
std::setlocale(LC_NUMERIC, "C");
87+
8588
m_plotsChooser = new PlotsChooser();
8689
connect(m_plotsChooser, &PlotsChooser::orderChanged, [&]() {
8790
QList<std::tuple<quint64, quint64>> filtersSelectors = m_plotsChooser->getFilterSelectorsOrder();

0 commit comments

Comments
 (0)