summaryrefslogtreecommitdiff
path: root/modules/mpa/decode.c
diff options
context:
space:
mode:
authorChristian Hoene <christian.hoene@symonics.com>2016-05-12 11:24:25 +0200
committerChristian Hoene <christian.hoene@symonics.com>2016-05-12 11:24:25 +0200
commita2713e0da4a884373b42b5d6672101c61bf443d2 (patch)
tree443e89efb0e597d5c4e220f8c183fca70af763a1 /modules/mpa/decode.c
parent0b67d2c0c57a9a247e3e4fc3b39d8f23e21ee342 (diff)
debug output pretty print
Diffstat (limited to 'modules/mpa/decode.c')
-rw-r--r--modules/mpa/decode.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/modules/mpa/decode.c b/modules/mpa/decode.c
index e862a1e..6ad1ffb 100644
--- a/modules/mpa/decode.c
+++ b/modules/mpa/decode.c
@@ -30,7 +30,7 @@ static void destructor(void *arg)
mpg123_close(ads->dec);
mpg123_delete(ads->dec);
#ifdef DEBUG
- debug("mpa: decoder destroyed\n");
+ debug("MPA dec destroyed\n");
#endif
}
@@ -47,7 +47,7 @@ int mpa_decode_update(struct audec_state **adsp, const struct aucodec *ac,
ads = *adsp;
#ifdef DEBUG
- debug("mpa: decoder created %s\n",fmtp);
+ debug("MPA dec created %s\n",fmtp);
#endif
if (ads)
@@ -73,8 +73,8 @@ int mpa_decode_update(struct audec_state **adsp, const struct aucodec *ac,
#else
result = mpg123_param(ads->dec, MPG123_VERBOSE, 0, 0.);
#endif
- if (result != MPG123_OK) {
- error("MPA libmpg123 param error %s\n",
+ if ( result != MPG123_OK) {
+ error("MPA dec param error %s\n",
mpg123_plain_strerror(result));
err = EINVAL;
goto out;
@@ -82,16 +82,16 @@ int mpa_decode_update(struct audec_state **adsp, const struct aucodec *ac,
result = mpg123_format_all(ads->dec);
- if (result != MPG123_OK) {
- error("MPA libmpg123 format error %s\n",
+ if ( result != MPG123_OK) {
+ error("MPA dec format error %s\n",
mpg123_plain_strerror(result));
err = EINVAL;
goto out;
}
result = mpg123_open_feed(ads->dec);
- if (result != MPG123_OK) {
- error("MPA libmpg123 open feed error %s\n",
+ if ( result != MPG123_OK) {
+ error("MPA dec open feed error %s\n",
mpg123_plain_strerror(result));
err = EINVAL;
goto out;
@@ -118,32 +118,32 @@ int mpa_decode_frm(struct audec_state *ads, int16_t *sampv, size_t *sampc,
spx_uint32_t out_len;
#ifdef DEBUG
- info("mpa decode start %d %ld\n",len, *sampc);
+ debug("MPA dec start %d %ld\n",len, *sampc);
#endif
if (!ads || !sampv || !sampc || !buf || len<=4)
return EINVAL;
if(*(uint32_t*)buf != 0) {
- error("MPA header is not zero %08X, not supported yet\n",
+ error("MPA dec header is not zero %08X, not supported yet\n",
*(uint32_t*)buf);
return EPROTO;
}
- n = 0;
- result = mpg123_decode(ads->dec, buf+4, len-4,
+ n = 0;
+ result = mpg123_decode(ads->dec, buf+4, len-4,
(unsigned char*)ads->intermediate_buffer,
sizeof(ads->intermediate_buffer), &n);
/* n counts bytes */
#ifdef DEBUG
- info("mpa decoded %d %d %d %d\n",result, len-4, n, ads->channels);
+ 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 libmpg123 format change %d %d %04X\n",samplerate
+ info("MPA dec format change %d %d %04X\n",samplerate
,channels,encoding);
ads->channels = channels;
@@ -155,17 +155,17 @@ int mpa_decode_frm(struct audec_state *ads, int16_t *sampv, size_t *sampc,
samplerate, 48000, 3, &result);
if (result!=RESAMPLER_ERR_SUCCESS
|| ads->resampler==NULL) {
- error("mpa: upsampler failed %d\n",result);
+ error("MPA dec upsampler failed %d\n",result);
return EINVAL;
}
}
else
ads->resampler = NULL;
}
- else if (result == MPG123_NEED_MORE) ;
-// return 0;
+ else if (result == MPG123_NEED_MORE)
+ ; /* workaround: do nothing */
else if (result != MPG123_OK) {
- error("MPA libmpg123 feed error %d %s\n", result,
+ error("MPA dec feed error %d %s\n", result,
mpg123_plain_strerror(result));
return EPROTO;
}
@@ -179,7 +179,7 @@ int mpa_decode_frm(struct audec_state *ads, int16_t *sampv, size_t *sampc,
ads->resampler, ads->intermediate_buffer,
&intermediate_len, sampv, &out_len);
if (result!=RESAMPLER_ERR_SUCCESS) {
- error("mpa: upsample error: %s %d %d\n",
+ error("MPA dec upsample error: %s %d %d\n",
strerror(result), out_len, *sampc/2);
return EPROTO;
}
@@ -205,7 +205,7 @@ int mpa_decode_frm(struct audec_state *ads, int16_t *sampv, size_t *sampc,
}
#ifdef DEBUG
- info("mpa decode done %d\n",*sampc);
+ debug("MPA dec done %d\n",*sampc);
#endif
}