summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Bigliardi <shammash@artha.org>2009-10-14 12:19:34 (GMT)
committer Luca Bigliardi <shammash@artha.org>2009-10-14 12:36:58 (GMT)
commit3f73d201d52622a23a072b8fc42ef6ecf3b8c797 (patch)
treeee36470a1fafd6162caf7ed1068eafd84f0c8fed
parent54611f9650874e48e879645cb6ae48f5b9bb4d2e (diff)
Load lame library in Stream_mixer constructor
Stream_mixer knows if lame is available. Signed-off-by: Luca Bigliardi <shammash@artha.org>
-rw-r--r--src/jmixer.cpp7
-rw-r--r--src/jmixer.h8
-rw-r--r--src/out_lame.cpp2
3 files changed, 14 insertions, 3 deletions
diff --git a/src/jmixer.cpp b/src/jmixer.cpp
index 852eed9..6444c27 100644
--- a/src/jmixer.cpp
+++ b/src/jmixer.cpp
@@ -106,6 +106,13 @@ Stream_mixer::Stream_mixer() {
fullduplex = true;
}
+ // check if we can use lame
+ lame_loaded = LameWrap::load();
+ if (lame_loaded) {
+ act("Lame library loaded");
+ } else {
+ act("Lame library NOT loaded");
+ }
/* this is the base seed for new encoders id */
idseed = 0; //abs(time(NULL) & getpid()) >> 2;
diff --git a/src/jmixer.h b/src/jmixer.h
index edf5bdd..6859658 100644
--- a/src/jmixer.h
+++ b/src/jmixer.h
@@ -325,7 +325,11 @@ class Stream_mixer {
bool fileout; ///< is there a file dumping? (redundant!)
bool quit; ///< should we keep on running?
-
+ /**
+ @brief check if lame can be used
+ @return true if lame has been dynamically loaded
+ */
+ bool is_lame_available() {return lame_loaded; };
@@ -369,6 +373,8 @@ class Stream_mixer {
Basic_scheduler *rsched;
public: void register_sched(Basic_scheduler *s) {rsched=s;};
#endif
+
+ bool lame_loaded; ///< has liblame been loaded?
};
#endif
diff --git a/src/out_lame.cpp b/src/out_lame.cpp
index f526b5f..3a03d89 100644
--- a/src/out_lame.cpp
+++ b/src/out_lame.cpp
@@ -40,8 +40,6 @@ OutLame::OutLame()
: OutChannel("lame") {
func("OutLame::OutLame()");
- // TODO(shammash): library load needs better checking
- LameWrap::load();
sprintf(name,"Lame MP3 encoder");
sprintf(version,"version %s",LameWrap::get_version());