-/*
- * Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
/*
* based in parts on libfaad, Copyright (C) 2003-2005 M. Bakker,
* Ahead Software AG
mp4ff_tag_t *tag = metadata.tags + i;
ret = -E_MP4FF_META_READ;
- if (mp4ff_meta_get_by_index(mp4ff, i,
- &tag->item, &tag->value) < 0)
+ if (!mp4ff_meta_get_by_index(mp4ff, i, &tag->item, &tag->value))
goto free_tags;
PARA_INFO_LOG("found: %s: %s\n", tag->item, tag->value);
if (!strcmp(tag->item, "artist"))
if (!found_comment)
add_tag(&metadata, "comment", tags->comment);
ret = -E_MP4FF_META_WRITE;
- if (mp4ff_meta_update(&cb, &metadata) < 0)
+ if (!mp4ff_meta_update(&cb, &metadata))
goto free_tags;
ret = 1;
free_tags:
}
static const char * const aac_suffixes[] = {"m4a", "mp4", NULL};
+
/**
- * the init function of the aac audio format handler
+ * The audio format handler for the Advanced Audio Codec.
*
- * \param afh pointer to the struct to initialize
+ * This is only compiled in if the faad library is installed.
*/
-void aac_afh_init(struct audio_format_handler *afh)
-{
- afh->get_file_info = aac_get_file_info,
- afh->suffixes = aac_suffixes;
- afh->rewrite_tags = aac_afh_rewrite_tags;
- afh->open = aac_afh_open;
- afh->get_chunk = aac_afh_get_chunk;
- afh->close = aac_afh_close;
-}
+const struct audio_format_handler aac_afh = {
+ .get_file_info = aac_get_file_info,
+ .suffixes = aac_suffixes,
+ .rewrite_tags = aac_afh_rewrite_tags,
+ .open = aac_afh_open,
+ .get_chunk = aac_afh_get_chunk,
+ .close = aac_afh_close,
+};