summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhaim alon <haim.alter@gmail.com>2009-10-24 20:40:00 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-10-24 20:40:00 +0000
commitc5898e862302090fee82c9eee230b6aa6e5d4e45 (patch)
tree17de17abd3a92e6b33e0e246c9dc7070b7ef7199
parentd3ee7715146e2d28279334abc5d46b6d968db8a1 (diff)
compute codec bitrate in mov demuxer, patch by haim alon, haim dot alter at gmail dot com
Originally committed as revision 20368 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mov.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index fdf921cb2a..79575185e5 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1429,6 +1429,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
unsigned int stss_index = 0;
unsigned int stps_index = 0;
unsigned int i, j;
+ uint64_t stream_size = 0;
/* adjust first dts according to edit list */
if (sc->time_offset) {
@@ -1488,6 +1489,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
}
current_offset += sample_size;
+ stream_size += sample_size;
current_dts += sc->stts_data[stts_index].duration;
distance++;
stts_sample++;
@@ -1498,6 +1500,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
}
}
}
+ st->codec->bit_rate = stream_size*8*sc->time_scale/st->duration;
} else {
for (i = 0; i < sc->chunk_count; i++) {
unsigned chunk_samples;