summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Bigliardi <shammash@artha.org>2009-10-14 12:21:00 (GMT)
committer Luca Bigliardi <shammash@artha.org>2009-10-14 12:36:58 (GMT)
commitb24aaa9dfcc3191e9ce4d256ed945cee35a281aa (patch)
tree3feeddfc7527013ef650ca1375466c02f6594b69
parent3f73d201d52622a23a072b8fc42ef6ecf3b8c797 (diff)
Create OutLame only if lame is available.
Signed-off-by: Luca Bigliardi <shammash@artha.org>
-rw-r--r--src/jmixer.cpp14
-rw-r--r--src/muse.cpp13
2 files changed, 18 insertions, 9 deletions
diff --git a/src/jmixer.cpp b/src/jmixer.cpp
index 6444c27..c95b01a 100644
--- a/src/jmixer.cpp
+++ b/src/jmixer.cpp
@@ -863,12 +863,16 @@ int Stream_mixer::create_enc(enum codec enc) {
#endif
case MP3:
- outch= new OutLame;
- if( ! ((OutLame*)outch)->init() ) {
- error("error initializing %s",outch->name);
- delete (OutLame*)outch;
+ if (lame_loaded) {
+ outch= new OutLame;
+ if( ! ((OutLame*)outch)->init() ) {
+ error("error initializing %s",outch->name);
+ delete (OutLame*)outch;
+ return -1;
+ }
+ } else {
+ error("Cannot create MP3 enc: lame is not loaded");
return -1;
-
}
break;
diff --git a/src/muse.cpp b/src/muse.cpp
index d7efbe0..ed2024e 100644
--- a/src/muse.cpp
+++ b/src/muse.cpp
@@ -316,9 +316,13 @@ bool take_args(int argc, char **argv) {
}
#endif
- if (strncasecmp("mp3",optarg,3) == 0) {
- encid = mix->create_enc(MP3);
- notice("CLI: created Mp3 encoder");
+ if (mix->is_lame_available()) {
+ if (strncasecmp("mp3",optarg,3) == 0) {
+ encid = mix->create_enc(MP3);
+ notice("CLI: created Mp3 encoder");
+ }
+ } else {
+ error("Asking for Mp3 encoder but LAME is not available.");
}
if(encid>0) outch = mix->get_enc(encid);
@@ -329,7 +333,8 @@ bool take_args(int argc, char **argv) {
#ifdef HAVE_VORBIS
act(" OGG - Ogg/Vorbis codec");
#endif
- act(" MP3 - Lame MP3 codec");
+ if (mix->is_lame_available())
+ act(" MP3 - Lame MP3 codec");
exit(0);
case 'b':