X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aac_afh.c;h=93d3bec8157702b9f769178d4d9c4ed5e81ecd2e;hp=b7e828f4d7c76287e871fee87dc17023215a80ab;hb=f2fa810c4bac275b4dc3ea9cd8b48d77e204618d;hpb=2187e113d02a2257cbbb02902a942946ffdc2e7e diff --git a/aac_afh.c b/aac_afh.c index b7e828f4..93d3bec8 100644 --- a/aac_afh.c +++ b/aac_afh.c @@ -15,8 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ -/** \file aac_afh.c para_server's aac audio format handler */ +/* + * based in parts on libfaad, Copyright (C) 2003-2005 M. Bakker, + * Ahead Software AG + */ +/** \file aac_afh.c para_server's aac audio format handler */ #include "server.cmdline.h" #include "server.h" @@ -66,11 +70,10 @@ static int aac_find_stsz(unsigned char *buf, unsigned buflen, unsigned *skip) return sample_count; } PARA_WARNING_LOG("stsz not found, buflen: %d\n", buflen); - return -E_STCO; + return -E_STSZ; } - -static int read_stsz(unsigned skip) +static int read_chunk_table(unsigned skip) { int ret, i; long unsigned sum = 0; @@ -109,7 +112,6 @@ static int read_stsz(unsigned skip) } - /* * Init m4a file and write some tech data to given pointers. */ @@ -151,12 +153,12 @@ static int aac_get_file_info(FILE *file, char *info_str, long unsigned *frames, } else PARA_WARNING_LOG("no mp4ASC %s\n", ""); - ret = read_stsz(skip); + ret = read_chunk_table(skip); if (ret < 0) return ret; *frames = num_chunks; for (;;) { - ret = aac_find_entry(inbuf, inbuf_len, &skip); + ret = aac_find_entry_point(inbuf, inbuf_len, &skip); if (ret >= 0) break; ret = read(fileno(infile), inbuf, inbuf_size); @@ -190,7 +192,8 @@ static int aac_get_file_info(FILE *file, char *info_str, long unsigned *frames, */ static int aac_reposition_stream(long unsigned request) { - return -E_AAC_REPOS; + return 1; +// return -E_AAC_REPOS; } static __must_check int para_fread(void *ptr, size_t size, size_t nmemb, FILE *stream) @@ -203,7 +206,7 @@ static __must_check int para_fread(void *ptr, size_t size, size_t nmemb, FILE *s return -E_FREAD; } -char *aac_read_chunk(long unsigned current_chunk, ssize_t *len) +static char *aac_read_chunk(long unsigned current_chunk, ssize_t *len) { int ret; size_t pos;