summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-03-06 16:24:50 +0000
committerBenny Prijono <bennylp@teluu.com>2006-03-06 16:24:50 +0000
commitb6e6db08da7424c10ca6ba3b27296a4b9b91eb3b (patch)
tree6b7049980ffd8aeebda658a7bfa62d4e6baab198
parentc8a71fcb85aa3fd6a2bd67cae8e976fcfb9d310d (diff)
Set minimum quality for Speex ultrawideband codec to 5 (because sound is broken in Linux)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@303 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjmedia/src/pjmedia-codec/speex_codec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/pjmedia/src/pjmedia-codec/speex_codec.c b/pjmedia/src/pjmedia-codec/speex_codec.c
index 590f4061..e8b9d0a4 100644
--- a/pjmedia/src/pjmedia-codec/speex_codec.c
+++ b/pjmedia/src/pjmedia-codec/speex_codec.c
@@ -24,14 +24,16 @@
#include <pjmedia/port.h>
#include <speex/speex.h>
#include <pj/assert.h>
+#include <pj/log.h>
#include <pj/pool.h>
#include <pj/string.h>
#include <pj/os.h>
+#define THIS_FILE "speex_codec.c"
+
#define DEFAULT_QUALITY 4
#define DEFAULT_COMPLEXITY -1
-
/* Prototypes for Speex factory */
static pj_status_t spx_test_alloc( pjmedia_codec_factory *factory,
const pjmedia_codec_info *id );
@@ -244,6 +246,12 @@ PJ_DEF(pj_status_t) pjmedia_codec_speex_init( pjmedia_endpt *endpt,
spx_factory.speex_param[PARAM_UWB].quality = quality;
spx_factory.speex_param[PARAM_UWB].complexity = complexity;
+ /* Somehow quality <=4 is broken in linux. */
+ if (quality <= 4) {
+ PJ_LOG(4,(THIS_FILE, "Adjusting quality to 5 for uwb"));
+ spx_factory.speex_param[PARAM_UWB].quality = 5;
+ }
+
/* Get codec framesize and avg bitrate for each mode. */
for (i=0; i<PJ_ARRAY_SIZE(spx_factory.speex_param); ++i) {
status = get_speex_info(&spx_factory.speex_param[i]);