X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afh.h;h=0486bd7784151df33c7c755011d270ee3ed905aa;hp=494a4e15adaf41bb10619b62c36a6a8a33a78fb4;hb=3150a0caa27a34d44556fb77f4a5aebc3d978580;hpb=fa578bf1d070161cafcbcc69ca7b810414ee1a4b diff --git a/afh.h b/afh.h index 494a4e15..0486bd77 100644 --- a/afh.h +++ b/afh.h @@ -80,7 +80,7 @@ struct audio_format_handler { /** * Check if this audio format handler can handle the file. * - * This is a pointer to a function returning whether a given file is + * This is a pointer to a function returning whether a given file is * valid for this audio format. A negative return value indicates that * this audio format handler is unable to decode the given file. On * success, the function must return a positive value and fill in the @@ -90,6 +90,8 @@ struct audio_format_handler { */ int (*get_file_info)(char *map, size_t numbytes, int fd, struct afh_info *afi); + /** Optional, used for header-rewriting. See \ref afh_get_header(). */ + void (*get_header)(void *map, size_t mapsize, char **buf, size_t *len); }; void afh_init(void); @@ -99,4 +101,6 @@ int compute_afhi(const char *path, char *data, size_t size, const char *audio_format_name(int); void afh_get_chunk(long unsigned chunk_num, struct afh_info *afhi, void *map, const char **buf, size_t *len); -void afh_get_header(struct afh_info *afhi, void *map, const char **buf, size_t *len); +void afh_get_header(struct afh_info *afhi, uint8_t audio_format_id, + void *map, size_t mapsize, char **buf, size_t *len); +void afh_free_header(char *header_buf, uint8_t audio_format_id);