summaryrefslogtreecommitdiff
path: root/ext/speex
diff options
context:
space:
mode:
authorDavid Hoyt <dhoyt@llnl.gov>2010-09-23 21:57:18 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-09-23 21:57:18 +0200
commit9f8619e5ca87c6abef11babcaf7fc41cc9d99002 (patch)
tree29b235b2969d72517078bb6914cbefafba833957 /ext/speex
parent3e894a1f29f7b5ea95d18cfa6166146fe312cdd5 (diff)
downloadgstreamer-plugins-good-9f8619e5ca87c6abef11babcaf7fc41cc9d99002.tar.gz
speex: Fix crashes with MSVC
Using the symbols for the different Speex modes results in crashes when using MSVC. Use the library functions to get the modes instead. Fixes bug #630378.
Diffstat (limited to 'ext/speex')
-rw-r--r--ext/speex/gstspeexdec.c2
-rw-r--r--ext/speex/gstspeexenc.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/ext/speex/gstspeexdec.c b/ext/speex/gstspeexdec.c
index e4ce80332..89293a37a 100644
--- a/ext/speex/gstspeexdec.c
+++ b/ext/speex/gstspeexdec.c
@@ -523,7 +523,7 @@ speex_dec_chain_parse_header (GstSpeexDec * dec, GstBuffer * buf)
if (dec->header->mode >= SPEEX_NB_MODES || dec->header->mode < 0)
goto mode_too_old;
- dec->mode = (SpeexMode *) speex_mode_list[dec->header->mode];
+ dec->mode = speex_lib_get_mode (dec->header->mode);
/* initialize the decoder */
dec->state = speex_decoder_init (dec->mode);
diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c
index 13ec29578..b8cb8728d 100644
--- a/ext/speex/gstspeexenc.c
+++ b/ext/speex/gstspeexenc.c
@@ -647,15 +647,15 @@ gst_speex_enc_setup (GstSpeexEnc * enc)
switch (enc->mode) {
case GST_SPEEX_ENC_MODE_UWB:
GST_LOG_OBJECT (enc, "configuring for requested UWB mode");
- enc->speex_mode = (SpeexMode *) & speex_uwb_mode;
+ enc->speex_mode = speex_lib_get_mode (SPEEX_MODEID_UWB);
break;
case GST_SPEEX_ENC_MODE_WB:
GST_LOG_OBJECT (enc, "configuring for requested WB mode");
- enc->speex_mode = (SpeexMode *) & speex_wb_mode;
+ enc->speex_mode = speex_lib_get_mode (SPEEX_MODEID_WB);
break;
case GST_SPEEX_ENC_MODE_NB:
GST_LOG_OBJECT (enc, "configuring for requested NB mode");
- enc->speex_mode = (SpeexMode *) & speex_nb_mode;
+ enc->speex_mode = speex_lib_get_mode (SPEEX_MODEID_NB);
break;
case GST_SPEEX_ENC_MODE_AUTO:
/* fall through */
@@ -667,9 +667,9 @@ gst_speex_enc_setup (GstSpeexEnc * enc)
if (enc->rate > 25000) {
if (enc->mode == GST_SPEEX_ENC_MODE_AUTO) {
GST_LOG_OBJECT (enc, "selected UWB mode for samplerate %d", enc->rate);
- enc->speex_mode = (SpeexMode *) & speex_uwb_mode;
+ enc->speex_mode = speex_lib_get_mode (SPEEX_MODEID_UWB);
} else {
- if (enc->speex_mode != &speex_uwb_mode) {
+ if (enc->speex_mode != speex_lib_get_mode (SPEEX_MODEID_UWB)) {
gst_speex_enc_set_last_msg (enc,
"Warning: suggest to use ultra wide band mode for this rate");
}
@@ -677,9 +677,9 @@ gst_speex_enc_setup (GstSpeexEnc * enc)
} else if (enc->rate > 12500) {
if (enc->mode == GST_SPEEX_ENC_MODE_AUTO) {
GST_LOG_OBJECT (enc, "selected WB mode for samplerate %d", enc->rate);
- enc->speex_mode = (SpeexMode *) & speex_wb_mode;
+ enc->speex_mode = speex_lib_get_mode (SPEEX_MODEID_WB);
} else {
- if (enc->speex_mode != &speex_wb_mode) {
+ if (enc->speex_mode != speex_lib_get_mode (SPEEX_MODEID_WB)) {
gst_speex_enc_set_last_msg (enc,
"Warning: suggest to use wide band mode for this rate");
}
@@ -687,9 +687,9 @@ gst_speex_enc_setup (GstSpeexEnc * enc)
} else {
if (enc->mode == GST_SPEEX_ENC_MODE_AUTO) {
GST_LOG_OBJECT (enc, "selected NB mode for samplerate %d", enc->rate);
- enc->speex_mode = (SpeexMode *) & speex_nb_mode;
+ enc->speex_mode = speex_lib_get_mode (SPEEX_MODEID_NB);
} else {
- if (enc->speex_mode != &speex_nb_mode) {
+ if (enc->speex_mode != speex_lib_get_mode (SPEEX_MODEID_NB)) {
gst_speex_enc_set_last_msg (enc,
"Warning: suggest to use narrow band mode for this rate");
}