]> git.tue.mpg.de Git - paraslash.git/commitdiff
aac: move aac_find_stsz from aac_common.c to to aac_afh.c
authorAndre <maan@p133.(none)>
Sat, 13 May 2006 04:20:17 +0000 (06:20 +0200)
committerAndre <maan@p133.(none)>
Sat, 13 May 2006 04:20:17 +0000 (06:20 +0200)
It is only used there.

aac.h
aac_afh.c
aac_common.c

diff --git a/aac.h b/aac.h
index 373872e756e3a80390d0507bebb4db4c982b3bac..015bff8c5516b746f13b637b1e5158ef664cc4de 100644 (file)
--- a/aac.h
+++ b/aac.h
@@ -4,5 +4,4 @@
 NeAACDecHandle aac_open(void);
 int aac_find_esds(unsigned char *buf, unsigned buflen, int *skip);
 int aac_find_entry(unsigned char *buf, unsigned buflen, int *skip);
-int aac_find_stsz(unsigned char *buf, unsigned buflen, unsigned *skip);
 unsigned aac_read_int32(unsigned char *buf);
index 93bcd427008e1ec088d9501394f5e1b5f108408f..b7e828f4d7c76287e871fee87dc17023215a80ab 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -44,6 +44,32 @@ static void aac_close_audio_file(void)
 {
 }
 
+static int aac_find_stsz(unsigned char *buf, unsigned buflen, unsigned *skip)
+{
+       int i;
+
+       for (i = 0; i + 16 < buflen; i++) {
+               unsigned char *p = buf + i;
+               unsigned sample_count, sample_size;
+
+               if (p[0] != 's' || p[1] != 't' || p[2] != 's' || p[3] != 'z')
+                       continue;
+               PARA_INFO_LOG("found stsz@%d\n", i);
+               i += 8;
+               sample_size = aac_read_int32(buf + i);
+               PARA_INFO_LOG("sample size: %d\n", sample_size);
+               i += 4;
+               sample_count = aac_read_int32(buf + i);
+               i += 4;
+               PARA_INFO_LOG("sample count: %d\n", sample_count);
+               *skip = i;
+               return sample_count;
+       }
+       PARA_WARNING_LOG("stsz not found, buflen: %d\n", buflen);
+       return -E_STCO;
+}
+
+
 static int read_stsz(unsigned skip)
 {
        int ret, i;
index 9edeb1c580b589229dec4aba14f0113c86d01bb2..148fefc36ad96394c4aa35991ec0bd74fe5184e5 100644 (file)
@@ -95,28 +95,3 @@ int aac_find_entry(unsigned char *buf, unsigned buflen, int *skip)
        return -E_STCO;
 }
 
-int aac_find_stsz(unsigned char *buf, unsigned buflen, unsigned *skip)
-{
-       int i;
-
-       for (i = 0; i + 16 < buflen; i++) {
-               unsigned char *p = buf + i;
-               unsigned sample_count, sample_size;
-
-               if (p[0] != 's' || p[1] != 't' || p[2] != 's' || p[3] != 'z')
-                       continue;
-               PARA_INFO_LOG("found stsz@%d\n", i);
-               i += 8;
-               sample_size = aac_read_int32(buf + i);
-               PARA_INFO_LOG("sample size: %d\n", sample_size);
-               i += 4;
-               sample_count = aac_read_int32(buf + i);
-               i += 4;
-               PARA_INFO_LOG("sample count: %d\n", sample_count);
-               *skip = i;
-               return sample_count;
-       }
-       PARA_WARNING_LOG("stsz not found, buflen: %d\n", buflen);
-       return -E_STCO;
-}
-