X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=flac_afh.c;h=2b5b6c1d9aa758e3d2e769756cc3d75f3bb57120;hp=e2d5380240240ddfaf3ce2b989ab0847f2e6e4fb;hb=HEAD;hpb=9d24300965cbcdfddb9f63b6bc8018da50d7d8e1 diff --git a/flac_afh.c b/flac_afh.c index e2d53802..2b5b6c1d 100644 --- a/flac_afh.c +++ b/flac_afh.c @@ -1,8 +1,4 @@ -/* - * Copyright (C) 2011 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2011 Andre Noll , see file COPYING. */ /** \file flac_afh.c Audio format handler for flac files. */ @@ -378,8 +374,8 @@ static int flac_afh_read_chunks(struct private_flac_afh_data *pfad) goto free_decoder; if (c >= chunk_table_size) { chunk_table_size = 2 * chunk_table_size + 100; - afhi->chunk_table = para_realloc(afhi->chunk_table, - chunk_table_size * sizeof(uint32_t)); + afhi->chunk_table = arr_realloc(afhi->chunk_table, + chunk_table_size, sizeof(uint32_t)); } afhi->chunk_table[c] = pos; @@ -485,7 +481,7 @@ static int flac_rewrite_tags(const char *map, size_t map_bytes, FLAC__Metadata_Iterator *iter; FLAC__StreamMetadata *b = NULL; FLAC__bool ok; - struct private_flac_afh_data *pfad = para_calloc(sizeof(*pfad)); + struct private_flac_afh_data *pfad = zalloc(sizeof(*pfad)); pfad->map = map; pfad->map_bytes = map_bytes; @@ -519,13 +515,12 @@ free_pfad: static const char * const flac_suffixes[] = {"flac", NULL}; /** - * The init function of the flac audio format handler. + * The audio format handler for flac (free lossless audio decoder). * - * \param afh pointer to the struct to initialize + * It depends on libflac and on libogg. */ -void flac_afh_init(struct audio_format_handler *afh) -{ - afh->get_file_info = flac_get_file_info, - afh->suffixes = flac_suffixes; - afh->rewrite_tags = flac_rewrite_tags; -} +const struct audio_format_handler flac_afh = { + .get_file_info = flac_get_file_info, + .suffixes = flac_suffixes, + .rewrite_tags = flac_rewrite_tags, +};