avctx->audio_service_type = s->service_type;
}
- if (avctx->codec_id != AV_CODEC_ID_EAC3)
- avctx->bit_rate = s->bit_rate;
+ /* Calculate the average bit rate */
+ s->frame_number++;
+ if (avctx->codec_id != AV_CODEC_ID_EAC3) {
+ avctx->bit_rate +=
+ (s->bit_rate - avctx->bit_rate) / s->frame_number;
+ }
}
return i;