/** define the array containing all supported audio formats */
const char *audio_formats[] = {AUDIOD_AUDIO_FORMAT_ARRAY NULL};
-/** defines how to handle one supported audio format */
+/** Defines how audiod handles one supported audio format. */
struct audio_format_info {
/** pointer to the receiver for this audio format */
struct receiver *receiver;
int get_audio_format_num(char *name)
{
int i;
+
+ while (isspace(*name))
+ name++;
FOR_EACH_AUDIO_FORMAT(i)
if (!strcmp(name, audio_formats[i]))
return i;
case SI_OFFSET:
stat_task->offset_seconds = atoi(line + ilen + 1);
break;
- case SI_LENGTH:
+ case SI_SECONDS_TOTAL:
stat_task->length_seconds = atoi(line + ilen + 1);
break;
case SI_STREAM_START:
return;
client_close(stat_task->pcd);
stat_task->pcd = NULL;
- for (i = 0; i < NUM_STAT_ITEMS; i++) {
+ FOR_EACH_STATUS_ITEM(i) {
free(stat_task->stat_item_values[i]);
stat_task->stat_item_values[i] = NULL;
}
audiod_status_dump();
stat_task->playing = 0;
stat_task->stat_item_values[SI_BASENAME] = make_message(
- "%s:no connection to para_server\n",
+ "%s: no connection to para_server\n",
status_item_list[SI_BASENAME]);
stat_client_write(stat_task->stat_item_values[SI_BASENAME],
SI_BASENAME);