Mercurial > hg > dmlib
diff minijss/jloadjss.c @ 1129:e466d10dae6d
Change API of jssDecodeSample{8,16}() functions to return dmlib error codes
instead of plain boolean value. Change some of the relevant places to use
this return value.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 04 Mar 2015 06:31:54 +0200 |
parents | e22d4ceb6414 |
children | aa3738b121d1 |
line wrap: on
line diff
--- a/minijss/jloadjss.c Wed Mar 04 06:11:58 2015 +0200 +++ b/minijss/jloadjss.c Wed Mar 04 06:31:54 2015 +0200 @@ -485,6 +485,7 @@ if (inst && inst->hasData) { + int ret; size_t sz; // Calculate data size @@ -509,9 +510,15 @@ // Convert, if needed if (inst->flags & jsf16bit) - jssDecodeSample16(inst->data, inst->size, inst->convFlags); + ret = jssDecodeSample16(inst->data, inst->size, inst->convFlags); else - jssDecodeSample8(inst->data, inst->size, inst->convFlags); + ret = jssDecodeSample8(inst->data, inst->size, inst->convFlags); + + if (ret != DMERR_OK) + { + JSSERROR(ret, ret, + "Failed to decode sample data for #%d\n", index); + } } } #else