-/*
- * Copyright (C) 2009 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2009 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
/** \file wma_afh.c The audio format handler for WMA files. */
ret = convert_utf8_to_utf16(tags->artist, &artist);
if (ret < 0)
return ret;
+ assert(artist);
artist_bytes = ret;
ret = convert_utf8_to_utf16(tags->title, &title);
if (ret < 0)
goto out;
+ assert(title);
title_bytes = ret;
ret = convert_utf8_to_utf16(tags->comment, &comment);
if (ret < 0)
goto out;
+ assert(comment);
comment_bytes = ret;
if (cdo) {
ret = convert_utf8_to_utf16(tags->album, &album);
if (ret < 0)
return ret;
+ assert(album);
album_bytes = ret;
ret = convert_utf8_to_utf16(tags->year, &year);
if (ret < 0)
goto out;
+ assert(year);
year_bytes = ret;
result->size = 16 + 8 + 2; /* GUID, size, count */
/* name_length + name + null + data type + val length + val */
static const char * const wma_suffixes[] = {"wma", NULL};
/**
- * The init function of the wma audio format handler.
+ * The audio format handler for Windows Media Audio.
*
- * \param afh Pointer to the struct to initialize.
+ * Only WMA version 2 is supported. This audio format handler does not depend
+ * on any third party libraries and is therefore always compiled in.
*/
-void wma_afh_init(struct audio_format_handler *afh)
-{
- afh->get_file_info = wma_get_file_info;
- afh->suffixes = wma_suffixes;
- afh->rewrite_tags = wma_rewrite_tags;
-}
+const struct audio_format_handler wma_afh = {
+ .get_file_info = wma_get_file_info,
+ .suffixes = wma_suffixes,
+ .rewrite_tags = wma_rewrite_tags,
+};