summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/encoderbase.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-08-20 18:41:17 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-06 21:13:32 +0100
commit07604d62ab375e5c4f42bd05704ace608600c478 (patch)
tree2564d760c71b6036cef730097fabf205508bc4ba /rbutil/rbutilqt/base/encoderbase.cpp
parentbb7aa6f3115c83d47851688b3482f3fa1c2ab32f (diff)
downloadrockbox-07604d62ab375e5c4f42bd05704ace608600c478.tar.gz
rockbox-07604d62ab375e5c4f42bd05704ace608600c478.tar.bz2
rockbox-07604d62ab375e5c4f42bd05704ace608600c478.zip
rbutil: Command line fallback on libmp3lame failure.
When loading libmp3lame fails fall back to using the command line lame. Avoids an unresolvable error when trying to create voice / talk files for Archos. Modernize code a bit. Change-Id: I2e8fd5786fda972cb24adbcb9ced531e08093b4f
Diffstat (limited to 'rbutil/rbutilqt/base/encoderbase.cpp')
-rw-r--r--rbutil/rbutilqt/base/encoderbase.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/base/encoderbase.cpp b/rbutil/rbutilqt/base/encoderbase.cpp
index 05ccae3011..90d7292b3a 100644
--- a/rbutil/rbutilqt/base/encoderbase.cpp
+++ b/rbutil/rbutilqt/base/encoderbase.cpp
@@ -23,6 +23,8 @@
#include "encoderlame.h"
#include "encoderexe.h"
+#include "Logger.h"
+
/*********************************************************************
* Encoder Base
**********************************************************************/
@@ -58,9 +60,17 @@ EncoderBase* EncoderBase::getEncoder(QObject* parent,QString encoder)
{
#if defined(Q_OS_MACX)
/* currently not on OS X */
- enc = new EncoderExe(encoder,parent);
+ enc = new EncoderExe(encoder, parent);
#else
enc = new EncoderLame(parent);
+ if (!enc->configOk())
+ {
+ LOG_WARNING() << "Could not load lame dll, falling back to command "
+ "line lame. This is notably slower.";
+ delete enc;
+ enc = new EncoderExe(encoder, parent);
+
+ }
#endif
return enc;
}