diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-08-20 18:41:17 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-06 21:13:32 +0100 |
commit | 07604d62ab375e5c4f42bd05704ace608600c478 (patch) | |
tree | 2564d760c71b6036cef730097fabf205508bc4ba /rbutil/rbutilqt/base/encoderbase.cpp | |
parent | bb7aa6f3115c83d47851688b3482f3fa1c2ab32f (diff) | |
download | rockbox-07604d62ab375e5c4f42bd05704ace608600c478.tar.gz 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.cpp | 12 |
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 @@ | |||
23 | #include "encoderlame.h" | 23 | #include "encoderlame.h" |
24 | #include "encoderexe.h" | 24 | #include "encoderexe.h" |
25 | 25 | ||
26 | #include "Logger.h" | ||
27 | |||
26 | /********************************************************************* | 28 | /********************************************************************* |
27 | * Encoder Base | 29 | * Encoder Base |
28 | **********************************************************************/ | 30 | **********************************************************************/ |
@@ -58,9 +60,17 @@ EncoderBase* EncoderBase::getEncoder(QObject* parent,QString encoder) | |||
58 | { | 60 | { |
59 | #if defined(Q_OS_MACX) | 61 | #if defined(Q_OS_MACX) |
60 | /* currently not on OS X */ | 62 | /* currently not on OS X */ |
61 | enc = new EncoderExe(encoder,parent); | 63 | enc = new EncoderExe(encoder, parent); |
62 | #else | 64 | #else |
63 | enc = new EncoderLame(parent); | 65 | enc = new EncoderLame(parent); |
66 | if (!enc->configOk()) | ||
67 | { | ||
68 | LOG_WARNING() << "Could not load lame dll, falling back to command " | ||
69 | "line lame. This is notably slower."; | ||
70 | delete enc; | ||
71 | enc = new EncoderExe(encoder, parent); | ||
72 | |||
73 | } | ||
64 | #endif | 74 | #endif |
65 | return enc; | 75 | return enc; |
66 | } | 76 | } |