]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mp4.c
mp4: Simplify and rename mp4ff_read_sample_getsize().
[paraslash.git] / mp4.c
diff --git a/mp4.c b/mp4.c
index 761eb375a615942175d3aa2a247aa5a12f1fda3d..7bef0d756edf746319380c670a6710a9654ed281 100644 (file)
--- a/mp4.c
+++ b/mp4.c
@@ -1509,28 +1509,13 @@ void mp4ff_set_sample_position(mp4ff_t *f, const int32_t track,
        mp4ff_set_position(f, offset);
 }
 
-static int32_t mp4ff_audio_frame_size(const mp4ff_t * f, const int32_t track,
-               const int32_t sample)
+int32_t mp4ff_get_sample_size(const mp4ff_t *f, int track, int sample)
 {
-       int32_t bytes;
-       const mp4ff_track_t *p_track = f->track[track];
-
-       if (p_track->stsz_sample_size) {
-               bytes = p_track->stsz_sample_size;
-       } else {
-               bytes = p_track->stsz_table[sample];
-       }
+       const mp4ff_track_t *t = f->track[track];
 
-       return bytes;
-}
-
-int32_t mp4ff_read_sample_getsize(mp4ff_t * f, const int track,
-                                 const int sample)
-{
-       int32_t temp = mp4ff_audio_frame_size(f, track, sample);
-       if (temp < 0)
-               temp = 0;
-       return temp;
+       if (t->stsz_sample_size != 0)
+               return t->stsz_sample_size;
+       return t->stsz_table[sample];
 }
 
 uint32_t mp4ff_get_sample_rate(const mp4ff_t * f, const int32_t track)