]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
aac: error cleanup
authorAndre <maan@p133.(none)>
Sat, 13 May 2006 05:09:52 +0000 (07:09 +0200)
committerAndre <maan@p133.(none)>
Sat, 13 May 2006 05:09:52 +0000 (07:09 +0200)
put each aac-related error message to its proper subsystem

aac_afh.c
aac_common.c
error.h

index ac73fb193aae276df743d85db91e3808711b5fbd..93d3bec8157702b9f769178d4d9c4ed5e81ecd2e 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -70,7 +70,7 @@ 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_chunk_table(unsigned skip)
@@ -192,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)
@@ -205,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;
index b3463b25284f62bc2cffbe74c501755864965e38..43e56000c4c4c1fab3746153dbb06a28a498f91d 100644 (file)
 #include "aac.h"
 #include "error.h"
 
+/**
+ * get a new libfaad decoder handle
+ *
+ */
 NeAACDecHandle aac_open(void)
 {
        NeAACDecHandle h = NeAACDecOpen();
@@ -97,6 +101,17 @@ unsigned aac_read_int32(unsigned char *buf)
        return (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
 }
 
+/**
+ * search for the first entry in the stco table
+ *
+ * \param buf buffer to seach
+ * \param buflen length of \a buf
+ * \param skip Upon succesful return, this contains the number
+ * of bytes to skip from the input buffer.
+ *
+ * \return the position of the first entry in the table on success,
+ * -E_STCO on errors.
+ */
 
 int aac_find_entry_point(unsigned char *buf, unsigned buflen, int *skip)
 {
diff --git a/error.h b/error.h
index eda696274f812e6d7c4a723d48879b203da458a9..b70f7b477094478b6b20267e582a459b386c040f 100644 (file)
--- a/error.h
+++ b/error.h
@@ -193,11 +193,14 @@ extern const char **para_errlist[];
 #define AAC_AFH_ERRORS \
        PARA_ERROR(AAC_REPOS, "aac repositioning error"), \
        PARA_ERROR(AAC_READ, "aac read error"), \
+       PARA_ERROR(STSZ, "did not find stcz atom"), \
 
 
 #define AAC_COMMON_ERRORS \
-       PARA_ERROR(AAC_OPEN, "NeAACDecOpen() failed"), \
        PARA_ERROR(AAC_BUF, "invalid buffer"), \
+       PARA_ERROR(ESDS, "did not find esds atom"), \
+       PARA_ERROR(STCO, "did not find stco atom"), \
+
 
 #define OGG_ERRORS \
        PARA_ERROR(OGG_READ, "ogg read error"), \
@@ -349,9 +352,6 @@ extern const char **para_errlist[];
 
 #define AACDEC_ERRORS \
        PARA_ERROR(AACDEC_INIT, "failed to init aac decoder"), \
-       PARA_ERROR(ESDS, "did not find esds atom"), \
-       PARA_ERROR(STSZ, "did not find stsz atom"), \
-       PARA_ERROR(STCO, "did not find stco atom"), \
        PARA_ERROR(AAC_DECODE, "aac decode error"), \
 
 /* these do not need error handling (yet) */