# HG changeset patch # User bcoudurier # Date 1256416800 0 # Node ID ff45ef768724204c1841e70fde00bf6b178a7c18 # Parent 4449e753bc78f2cbab96495bd816e870f4acb0cc compute codec bitrate in mov demuxer, patch by haim alon, haim dot alter at gmail dot com diff -r 4449e753bc78 -r ff45ef768724 mov.c --- a/mov.c Sat Oct 24 16:53:06 2009 +0000 +++ b/mov.c Sat Oct 24 20:40:00 2009 +0000 @@ -1429,6 +1429,7 @@ 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 @@ } current_offset += sample_size; + stream_size += sample_size; current_dts += sc->stts_data[stts_index].duration; distance++; stts_sample++; @@ -1498,6 +1500,7 @@ } } } + st->codec->bit_rate = stream_size*8*sc->time_scale/st->duration; } else { for (i = 0; i < sc->chunk_count; i++) { unsigned chunk_samples;