From 5daccf4268f16d56cecc306e705703e170cf3597 Mon Sep 17 00:00:00 2001 From: Oleg Kisselef Date: Fri, 24 Apr 2015 15:40:15 +0600 Subject: [PATCH] gpac size calculation fix merged from gpac repo --- src/gpacmp4/isom_read.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gpacmp4/isom_read.c b/src/gpacmp4/isom_read.c index 420502ac..ced0c711 100644 --- a/src/gpacmp4/isom_read.c +++ b/src/gpacmp4/isom_read.c @@ -1736,15 +1736,15 @@ GF_Err gf_isom_get_chunks_infos(GF_ISOFile *movie, u32 trackNumber, u32 *dur_min chunk_dur += dur; stbl_GetSampleSize(trak->Media->information->sampleTable->SampleSize, k+sample_idx, &size); chunk_size += size; - + } if (dmin>chunk_dur) dmin = chunk_dur; if (dmaxchunk_size) smin = chunk_size; if (smaxentries[i].samplesPerChunk; if (i+1==stsc->nb_entries) break; @@ -1752,8 +1752,10 @@ GF_Err gf_isom_get_chunks_infos(GF_ISOFile *movie, u32 trackNumber, u32 *dur_min if (stsc->entries[i].firstChunk + nb_chunk == stsc->entries[i+1].firstChunk) break; } } - if (tot_chunks) davg /= tot_chunks; - + if (tot_chunks) { + davg /= tot_chunks; + savg /= tot_chunks; + } if (dur_min) *dur_min = dmin; if (dur_avg) *dur_avg = (u32) davg; if (dur_max) *dur_max = dmax;