From 97ab6bd0be0accf02a4603441ab75f42a0f755b2 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Fri, 27 Jan 2012 03:21:59 +0100 Subject: [PATCH] Fix regular expression for new version of Monkey's Audio. --- src/Config.h | 2 +- src/Decoder_MAC.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Config.h b/src/Config.h index d018561c..addaebe7 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 4 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 17 -#define VER_LAMEXP_BUILD 886 +#define VER_LAMEXP_BUILD 888 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Decoder_MAC.cpp b/src/Decoder_MAC.cpp index b8755e29..621ce763 100644 --- a/src/Decoder_MAC.cpp +++ b/src/Decoder_MAC.cpp @@ -57,8 +57,9 @@ bool MACDecoder::decode(const QString &sourceFile, const QString &outputFile, vo bool bTimeout = false; bool bAborted = false; + int prevProgress = -1; - QRegExp regExp("Progress: (\\d+)%"); + QRegExp regExp("Progress: (\\d+).(\\d+)%"); while(process.state() != QProcess::NotRunning) { @@ -86,7 +87,11 @@ bool MACDecoder::decode(const QString &sourceFile, const QString &outputFile, vo { bool ok = false; int progress = regExp.cap(1).toInt(&ok); - if(ok) emit statusUpdated(progress); + if(ok && (progress > prevProgress)) + { + emit statusUpdated(progress); + prevProgress = qMin(progress + 2, 99); + } } else if(!text.isEmpty()) {