paraslash 0.7.3
[paraslash.git] / spx_afh.c
index cd65ac519c0673c0b9df997f7608e2c86b5920dd..cd3b7cde907388465f04ead39af10bd125d154ca 100644 (file)
--- a/spx_afh.c
+++ b/spx_afh.c
@@ -1,8 +1,4 @@
-/*
- * Copyright (C) 2010 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2010 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
 
 /* This file is based on speexdec.c, by Jean-Marc Valin, see below. */
 
 
 /* This file is based on speexdec.c, by Jean-Marc Valin, see below. */
 
@@ -199,7 +195,7 @@ static size_t spx_make_meta_packet(struct taginfo *tags, char **result)
        }
        PARA_DEBUG_LOG("meta packet size: %zu bytes\n", sz);
        /* terminating zero byte for the last sprintf() */
        }
        PARA_DEBUG_LOG("meta packet size: %zu bytes\n", sz);
        /* terminating zero byte for the last sprintf() */
-       buf = p = para_malloc(sz + 1);
+       buf = p = alloc(sz + 1);
        write_u32(p, comment_sz);
        p += 4;
        strcpy(p, tags->comment);
        write_u32(p, comment_sz);
        p += 4;
        strcpy(p, tags->comment);
@@ -252,13 +248,14 @@ static int spx_rewrite_tags(const char *map, size_t mapsize,
 static const char * const speex_suffixes[] = {"spx", "speex", NULL};
 
 /**
 static const char * const speex_suffixes[] = {"spx", "speex", NULL};
 
 /**
- * The init function of the ogg/speex audio format handler.
+ * The ogg/speex audio format handler.
  *
  *
- * \param afh Pointer to the struct to initialize.
+ * This codec is considered obsolete because the opus codec surpasses its
+ * performance in all areas. It is only compiled in if both the ogg and the
+ * speex library are installed.
  */
  */
-void spx_afh_init(struct audio_format_handler *afh)
-{
-       afh->get_file_info = spx_get_file_info,
-       afh->suffixes = speex_suffixes;
-       afh->rewrite_tags = spx_rewrite_tags;
-}
+const struct audio_format_handler spx_afh = {
+       .get_file_info = spx_get_file_info,
+       .suffixes = speex_suffixes,
+       .rewrite_tags = spx_rewrite_tags,
+};