]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - opus_afh.c
paraslash 0.7.3
[paraslash.git] / opus_afh.c
index ed6fe5c80625487d6d6cc852a349650f4cd80ad8..0a291bb16c18b6705b70ff0260e97b502068f500 100644 (file)
@@ -179,7 +179,7 @@ static size_t opus_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() */
-       buf = p = para_malloc(sz + 1);
+       buf = p = alloc(sz + 1);
        memcpy(p, OPUS_COMMENT_HEADER, strlen(OPUS_COMMENT_HEADER));
        p += strlen(OPUS_COMMENT_HEADER);
        write_u32(p, comment_sz);
@@ -291,14 +291,15 @@ static void opus_get_header(void *map, size_t mapsize, char **buf,
 }
 
 /**
- * The init function of the ogg/opus audio format handler.
+ * The audio format handler for ogg/opus.
  *
- * \param afh Pointer to the struct to initialize.
+ * The opus codec was standardized by the Internet Engineering Task Force and
+ * is described in RFC 6716 (2012). The audio format handler depends on the ogg
+ * and the opus libraries.
  */
-void opus_afh_init(struct audio_format_handler *afh)
-{
-       afh->get_file_info = opus_get_file_info,
-       afh->get_header = opus_get_header;
-       afh->suffixes = opus_suffixes;
-       afh->rewrite_tags = opus_rewrite_tags;
-}
+const struct audio_format_handler opus_afh = {
+       .get_file_info = opus_get_file_info,
+       .get_header = opus_get_header,
+       .suffixes = opus_suffixes,
+       .rewrite_tags = opus_rewrite_tags,
+};