In case one switches back and forth between different versions of
para_server that support different audio formats, it may happen
that the aft table contains entries for audio formats that are not
supported by the version currently running.
ATM, this causes para_server to die immediately because of the
assertion in audio_format_name. Replace the assertion by a less
draconian run time check that returns the string "???" if the number
for an unknown audio file format is being looked up.
*/
const char *audio_format_name(int i)
{
- //PARA_NOTICE_LOG("array size: %u¸ requested: %d\n", ARRAY_SIZE(afl), i);
- assert(i < 0 || i < ARRAY_SIZE(afl) - 1);
- return i >= 0? afl[i].name : "(none)";
+ if (i < 0 || i >= ARRAY_SIZE(afl) - 1)
+ return "???";
+ return afl[i].name;
}
/**