X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aac_afh.c;h=e68004b24a4648f09d624e6e428ddc7d3072b27e;hp=f29e55bb8eec3608c463032f46d5d5aae69efded;hb=4cfbdce5e460934d4724cac63aa718ea6c7af199;hpb=075a9c88085a4925bcb44857de3d025aa3cdd398 diff --git a/aac_afh.c b/aac_afh.c index f29e55bb..e68004b2 100644 --- a/aac_afh.c +++ b/aac_afh.c @@ -136,7 +136,7 @@ static long unsigned aac_set_chunk_tv(mp4AudioSpecificConfig *mp4ASC) * Init m4a file and write some tech data to given pointers. */ static int aac_get_file_info(FILE *file, char *info_str, long unsigned *frames, - int *seconds) + int *seconds, size_t **vss_chunk_table) { int i, ret, decoder_len; size_t skip; @@ -172,6 +172,7 @@ static int aac_get_file_info(FILE *file, char *info_str, long unsigned *frames, return ret; *frames = num_chunks; *seconds = aac_set_chunk_tv(&mp4ASC); + *vss_chunk_table = chunk_table; for (;;) { ret = aac_find_entry_point(inbuf, inbuf_len, &skip); if (ret >= 0) @@ -193,52 +194,12 @@ static int aac_get_file_info(FILE *file, char *info_str, long unsigned *frames, return 1; } -/* - * nothing to do as we'll seek to the correct offset in aac read_chunk() anyway - */ -static int aac_reposition_stream(__a_unused long unsigned request) -{ - return 1; -} - -static char *aac_read_chunk(long unsigned current_chunk, ssize_t *len) -{ - int ret; - size_t pos; - - *len = 0; - if (current_chunk >= num_chunks) - return NULL; - pos = chunk_table[current_chunk]; - *len = chunk_table[current_chunk + 1] - chunk_table[current_chunk]; - if (inbuf_size < *len) { - PARA_INFO_LOG("increasing inbuf for chunk #%lu/%zu to %zd bytes\n", - current_chunk, num_chunks, *len); - inbuf = para_realloc(inbuf, *len); - inbuf_size = *len; - } -// PARA_DEBUG_LOG("reading chunk #%lu@%zd (%zd bytes)\n", current_chunk, -// pos, *len); - ret = fseek(infile, pos, SEEK_SET); - if (ret < 0) - return NULL; - ret = para_fread(inbuf, *len, 1, infile); - if (ret != *len) - return NULL; -// PARA_DEBUG_LOG("ret: %d, inbuf[0]: %lx - %lx\n", ret, (long unsigned) inbuf[0], -// (long unsigned) inbuf[4]); - return (char *)inbuf; -} - - static const char* aac_suffixes[] = {"m4a", "mp4", NULL}; /** the init function of the aac audio format handler */ void aac_afh_init(struct audio_format_handler *p) { af = p; - af->reposition_stream = aac_reposition_stream; af->get_file_info = aac_get_file_info, - af->read_chunk = aac_read_chunk; af->close_audio_file = aac_close_audio_file; af->get_header_info = NULL; af->suffixes = aac_suffixes;