summaryrefslogtreecommitdiff
path: root/modules/mpa/decode.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mpa/decode.c')
-rw-r--r--modules/mpa/decode.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/mpa/decode.c b/modules/mpa/decode.c
index 3a1c0a2..b71a335 100644
--- a/modules/mpa/decode.c
+++ b/modules/mpa/decode.c
@@ -40,6 +40,7 @@ int mpa_decode_update(struct audec_state **adsp, const struct aucodec *ac,
{
struct audec_state *ads;
int result, err=0;
+ (void)fmtp;
if (!adsp || !ac || !ac->ch)
return EINVAL;
@@ -62,7 +63,7 @@ int mpa_decode_update(struct audec_state **adsp, const struct aucodec *ac,
ads->dec = mpg123_new(NULL,&result);
if (!ads->dec) {
- error("mpa: decoder create: %s\n",
+ error("MPA dec create: %s\n",
mpg123_plain_strerror(result));
err = ENOMEM;
goto out;
@@ -135,12 +136,10 @@ int mpa_decode_frm(struct audec_state *ads, int16_t *sampv, size_t *sampc,
(unsigned char*)ads->intermediate_buffer,
sizeof(ads->intermediate_buffer), &n);
/* n counts bytes */
-
#ifdef DEBUG
debug("MPA dec %d %d %d %d\n",result, len-4, n, ads->channels);
#endif
-
if (result == MPG123_NEW_FORMAT) {
mpg123_getformat(ads->dec, &samplerate, &channels, &encoding);
info("MPA dec format change %d %d %04X\n",samplerate
@@ -150,9 +149,9 @@ int mpa_decode_frm(struct audec_state *ads, int16_t *sampv, size_t *sampc,
ads->start = 0;
if (ads->resampler)
speex_resampler_destroy(ads->resampler);
- if (samplerate != 48000) {
+ if (samplerate != MPA_IORATE) {
ads->resampler = speex_resampler_init(channels,
- samplerate, 48000, 3, &result);
+ (uint32_t)samplerate, MPA_IORATE, 3, &result);
if (result!=RESAMPLER_ERR_SUCCESS
|| ads->resampler==NULL) {
error("MPA dec upsampler failed %d\n",result);