X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audiod.c;h=f7e481b4c66be206785e1043eb8a59e733938069;hp=2a78332f2133c854937b4be239990cc6a3e1caf8;hb=ab0e988bdbccd590a3e7ad101ae152ead4d2bfdb;hpb=7e58bd75a29d2d4e1d184191c2500b6aa7a7ad8a diff --git a/audiod.c b/audiod.c index 2a78332f..f7e481b4 100644 --- a/audiod.c +++ b/audiod.c @@ -33,7 +33,7 @@ INIT_AUDIOD_ERRLISTS; /** 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; @@ -118,6 +118,9 @@ struct command_task { 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; @@ -516,7 +519,7 @@ static int check_stat_line(char *line, __a_unused void *data) 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: @@ -957,11 +960,11 @@ static void close_stat_pipe(void) stat_task->offset_seconds = 0; audiod_status_dump(); stat_task->playing = 0; - stat_task->stat_item_values[SI_STATUS_BAR] = make_message( + stat_task->stat_item_values[SI_BASENAME] = make_message( "%s:no connection to para_server\n", - status_item_list[SI_STATUS_BAR]); - stat_client_write(stat_task->stat_item_values[SI_STATUS_BAR], - SI_STATUS_BAR); + status_item_list[SI_BASENAME]); + stat_client_write(stat_task->stat_item_values[SI_BASENAME], + SI_BASENAME); if (stat_task->clock_diff_count) { stat_task->clock_diff_barrier.tv_sec = now->tv_sec + 1; stat_task->clock_diff_barrier.tv_usec = now->tv_usec;