}
/**
- * get the name of the given audio format
+ * Get the name of the given audio format.
*
- * \param i the audio format number
+ * \param i The audio format number.
*
* This returns a pointer to statically allocated memory so it
* must not be freed by the caller.
*/
const char *audio_format_name(int i)
{
- return i >= 0? afl[i].name : "(none)";
+ assert(i >= 0 && i < ARRAY_SIZE(afl));
+ return afl[i].name;
}
/**
PARA_DEBUG_LOG("supported audio formats: %s\n",
SUPPORTED_AUDIO_FORMATS);
- for (i = 0; afl[i].name; i++) {
+ FOR_EACH_AUDIO_FORMAT(i) {
PARA_NOTICE_LOG("initializing %s handler\n",
afl[i].name);
afl[i].init(&afl[i]);
ret = afl[i].get_file_info(data, size, afhi);
if (ret >= 0)
return i;
+ PARA_WARNING_LOG("%s\n", PARA_STRERROR(-ret));
}
return -E_AUDIO_FORMAT;
}