Browse Source

Merge commit '4723c6226aa1ece4099338cc9b38a9cef4fa4846'

* commit '4723c6226aa1ece4099338cc9b38a9cef4fa4846':
  dashenc: fix bitrate estimation with correct scaling

Merged-by: James Almer <jamrial@gmail.com>
tags/n4.0
James Almer 8 years ago
parent
commit
362372c46b
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavformat/dashenc.c

+ 3
- 1
libavformat/dashenc.c View File

@@ -1005,7 +1005,9 @@ static int dash_flush(AVFormatContext *s, int final, int stream)

if (!os->bit_rate) {
// calculate average bitrate of first segment
int64_t bitrate = (int64_t) range_length * 8 / ((os->max_pts - os->start_pts) * av_q2d(st->time_base));
int64_t bitrate = (int64_t) range_length * 8 * AV_TIME_BASE / av_rescale_q(os->max_pts - os->start_pts,
st->time_base,
AV_TIME_BASE_Q);
if (bitrate >= 0) {
os->bit_rate = bitrate;
snprintf(os->bandwidth_str, sizeof(os->bandwidth_str),


Loading…
Cancel
Save