aft: Avoid invalid read.
[paraslash.git] / ogg_afh_common.h
index 7b9d1313af4816b79d1177c7898b94a70ee24775..e0cf2d40c3ffb825c9f19338aa792558cb1c8742 100644 (file)
@@ -1,14 +1,16 @@
-/*
- * 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. */
 
 /**
  * \file ogg_afh_common.h Structures and prototypes common to audio format
  * handlers that use the ogg container format.
  */
 
 
 /**
  * \file ogg_afh_common.h Structures and prototypes common to audio format
  * handlers that use the ogg container format.
  */
 
+struct oac_custom_header *oac_custom_header_new(void);
+void oac_custom_header_init(int serial, struct oac_custom_header *h);
+int oac_custom_header_append(ogg_packet *op, struct oac_custom_header *h);
+void oac_custom_header_flush(struct oac_custom_header *h);
+size_t oac_custom_header_get(char **buf, struct oac_custom_header *h);
+
 /**
  * Callback structure provided by audio format handlers.
  *
 /**
  * Callback structure provided by audio format handlers.
  *
@@ -16,7 +18,7 @@
  * function whose purpose is to extract the meta information about the audio
  * file from the first few ogg packets of the bitstream.
  */
  * function whose purpose is to extract the meta information about the audio
  * file from the first few ogg packets of the bitstream.
  */
-struct ogg_afh_callback_info {
+struct oac_callback_info {
        /**
         * ogg_get_file_info() calls this function for the first three ogg
         * packets, or until the callback returns a non-positive value. If it
        /**
         * ogg_get_file_info() calls this function for the first three ogg
         * packets, or until the callback returns a non-positive value. If it
@@ -33,7 +35,7 @@ struct ogg_afh_callback_info {
        void *private_data;
 };
 
        void *private_data;
 };
 
-int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
-               struct ogg_afh_callback_info *ci);
-int ogg_rewrite_tags(const char *map, size_t mapsize, int fd,
+int oac_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
+               struct oac_callback_info *ci);
+int oac_rewrite_tags(const char *map, size_t mapsize, int fd,
                char *meta_packet, size_t meta_sz);
                char *meta_packet, size_t meta_sz);