X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afh_common.c;h=5b6301b5f3d06405930df8fbcc64c7095f7ece06;hp=44a6fd62cbe50c758aba17b33dd45c0e7eb831c6;hb=4744d937c4160898d1fe151257606430750e580c;hpb=5ff2b0b3a6f9242033c436fb8272245f5594dd8c diff --git a/afh_common.c b/afh_common.c index 44a6fd62..5b6301b5 100644 --- a/afh_common.c +++ b/afh_common.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1997-2011 Andre Noll + * Copyright (C) 1997-2012 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -28,8 +28,15 @@ void mp3_init(struct audio_format_handler *); #ifdef HAVE_SPEEX void spx_afh_init(struct audio_format_handler *); #endif +#ifdef HAVE_FLAC + void flac_afh_init(struct audio_format_handler *); +#endif void wma_afh_init(struct audio_format_handler *); + +/** The list of all status items */ +const char *status_item_list[] = {STATUS_ITEM_ARRAY}; + /** * The list of supported audio formats. * @@ -67,6 +74,12 @@ static struct audio_format_handler afl[] = { .name = "spx", #ifdef HAVE_SPEEX .init = spx_afh_init, +#endif + }, + { + .name = "flac", +#ifdef HAVE_FLAC + .init = flac_afh_init, #endif }, { @@ -208,6 +221,26 @@ success: return ret; } +/** + * Deallocate contents of a filled-in ahi structure + * + * \param afhi The structure to clear. + * + * The given pointer is kept, everything else is freed. + */ +void clear_afhi(struct afh_info *afhi) +{ + if (!afhi) + return; + free(afhi->chunk_table); + free(afhi->techinfo); + free(afhi->tags.artist); + free(afhi->tags.title); + free(afhi->tags.year); + free(afhi->tags.album); + free(afhi->tags.comment); +} + /** * Get the name of the given audio format. *