[FFmpeg-cvslog] r20368 - trunk/libavformat/mov.c
bcoudurier
subversion
Sat Oct 24 22:40:01 CEST 2009
Author: bcoudurier
Date: Sat Oct 24 22:40:00 2009
New Revision: 20368
Log:
compute codec bitrate in mov demuxer, patch by haim alon, haim dot alter at gmail dot com
Modified:
trunk/libavformat/mov.c
Modified: trunk/libavformat/mov.c
==============================================================================
--- trunk/libavformat/mov.c Sat Oct 24 19:24:25 2009 (r20367)
+++ trunk/libavformat/mov.c Sat Oct 24 22:40:00 2009 (r20368)
@@ -1429,6 +1429,7 @@ static void mov_build_index(MOVContext *
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 *
}
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 *
}
}
}
+ st->codec->bit_rate = stream_size*8*sc->time_scale/st->duration;
} else {
for (i = 0; i < sc->chunk_count; i++) {
unsigned chunk_samples;
More information about the ffmpeg-cvslog
mailing list