X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afh_common.c;h=cb773bd69bb2cc2706969e280685cadc160b2e01;hp=dd9b319289f1c6e5da316926fdfafb8eb7ede4fc;hb=30e16b04db8733e17fcf887508f2c33088eef2b6;hpb=66b97974ebba5c6ea967b713f84f62a1b72da8d2 diff --git a/afh_common.c b/afh_common.c index dd9b3192..cb773bd6 100644 --- a/afh_common.c +++ b/afh_common.c @@ -1,8 +1,4 @@ -/* - * Copyright (C) 1997 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 1997 Andre Noll , see file COPYING. */ /** \file afh_common.c Common audio format handler functions. */ @@ -89,6 +85,21 @@ static struct audio_format_handler afl[] = { } }; +/** + * Get the name of the given audio format. + * + * \param i The audio format number. + * + * \return This returns a pointer to statically allocated memory so it + * must not be freed by the caller. + */ +const char *audio_format_name(int i) +{ + if (i < 0 || i >= ARRAY_SIZE(afl) - 1) + return "???"; + return afl[i].name; +} + static inline int next_audio_format(int format) { for (;;) { @@ -164,21 +175,6 @@ int guess_audio_format(const char *name) return -E_AUDIO_FORMAT; } -/** - * Get the name of the given audio format. - * - * \param i The audio format number. - * - * \return This returns a pointer to statically allocated memory so it - * must not be freed by the caller. - */ -const char *audio_format_name(int i) -{ - if (i < 0 || i >= ARRAY_SIZE(afl) - 1) - return "???"; - return afl[i].name; -} - static int get_file_info(int format, const char *path, char *data, size_t size, int fd, struct afh_info *afhi) { @@ -317,7 +313,7 @@ __must_check int afh_get_chunk(long unsigned chunk_num, struct afh_info *afhi, if (ret < 0) return ret; } - ret = afl[audio_format_id].get_chunk(chunk_num, *afh_context, + ret = afh->get_chunk(chunk_num, *afh_context, buf, len); if (ret < 0) { afh->close(*afh_context);