mp4: Remove two unused arrays from struct mp4_track.
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 19 Aug 2021 14:08:46 +0000 (16:08 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 May 2022 19:37:35 +0000 (21:37 +0200)
These arrays are allocated and initialized but their values are
never read.

mp4.c

diff --git a/mp4.c b/mp4.c
index 09a3c743cb60439f27217b440f84d9e7c4d80f37..c77cedd2bd2fb586a715b12c5808f7691bc35c57 100644 (file)
--- a/mp4.c
+++ b/mp4.c
@@ -25,13 +25,11 @@ struct mp4_track {
        /* stts */
        uint32_t stts_entry_count;
        uint32_t *stts_sample_count;
-       uint32_t *stts_sample_delta;
 
        /* stsc */
        uint32_t stsc_entry_count;
        uint32_t *stsc_first_chunk;
        uint32_t *stsc_samples_per_chunk;
-       uint32_t *stsc_sample_desc_index;
 
        /* stsc */
        uint32_t stco_entry_count;
@@ -493,13 +491,11 @@ static int read_stts(struct mp4 *f)
                return ret;
        t->stts_sample_count = para_malloc(t->stts_entry_count
                * sizeof(int32_t));
-       t->stts_sample_delta = para_malloc(t->stts_entry_count
-               * sizeof (int32_t));
        for (i = 0; i < t->stts_entry_count; i++) {
                ret = read_int32(f, &t->stts_sample_count[i]);
                if (ret <= 0)
                        return ret;
-               ret = read_int32(f, &t->stts_sample_delta[i]);
+               ret = read_int32(f, NULL); /* sample delta */
                if (ret <= 0)
                        return ret;
        }
@@ -528,9 +524,6 @@ static int read_stsc(struct mp4 *f)
        t->stsc_first_chunk = para_malloc(t->stsc_entry_count * sizeof(int32_t));
        t->stsc_samples_per_chunk = para_malloc(t->stsc_entry_count
                * sizeof (int32_t));
-       t->stsc_sample_desc_index = para_malloc(t->stsc_entry_count *
-               sizeof (int32_t));
-
        for (i = 0; i < t->stsc_entry_count; i++) {
                ret = read_int32(f, &t->stsc_first_chunk[i]);
                if (ret <= 0)
@@ -538,7 +531,7 @@ static int read_stsc(struct mp4 *f)
                ret = read_int32(f, &t->stsc_samples_per_chunk[i]);
                if (ret <= 0)
                        return ret;
-               ret = read_int32(f, &t->stsc_sample_desc_index[i]);
+               ret = read_int32(f, NULL); /* sample desc index */
                if (ret <= 0)
                        return ret;
        }
@@ -970,10 +963,8 @@ void mp4_close(struct mp4 *f)
                if (f->track[i]) {
                        free(f->track[i]->stsz_table);
                        free(f->track[i]->stts_sample_count);
-                       free(f->track[i]->stts_sample_delta);
                        free(f->track[i]->stsc_first_chunk);
                        free(f->track[i]->stsc_samples_per_chunk);
-                       free(f->track[i]->stsc_sample_desc_index);
                        free(f->track[i]->stco_chunk_offset);
                        free(f->track[i]);
                }