]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - aac_afh.c
mp4: Improve mp4_get_sample_size().
[paraslash.git] / aac_afh.c
index b45db477e0e80ddbe1f170446c92e2df99cdc9e1..de99613d2df6adfa506940d454b61e1b893b7c73 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -90,7 +90,7 @@ static int aac_afh_get_chunk(uint32_t chunk_num, void *afh_context,
                const char **buf, uint32_t *len)
 {
        struct aac_afh_context *c = afh_context;
-       int32_t ss;
+       uint32_t ss;
        size_t offset;
        int ret;
 
@@ -98,9 +98,9 @@ static int aac_afh_get_chunk(uint32_t chunk_num, void *afh_context,
        if (ret < 0)
                return ret;
        offset = c->fpos;
-       ss = mp4_get_sample_size(c->mp4, chunk_num);
-       if (ss <= 0)
-               return -E_MP4_BAD_SAMPLE;
+       ret = mp4_get_sample_size(c->mp4, chunk_num, &ss);
+       if (ret < 0)
+               return ret;
        assert(ss + offset <= c->mapsize);
        *buf = c->map + offset;
        *len = ss;