Skip to content

Commit

Permalink
avformat/dashenc: use AVStream timebase when computing missing bitrate
Browse files Browse the repository at this point in the history
  • Loading branch information
pszemus authored and jkarthic-akamai committed Jun 1, 2020
1 parent 317b722 commit 2a9ffd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavformat/dashenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1959,7 +1959,7 @@ 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 * AV_TIME_BASE / duration;
int64_t bitrate = (int64_t) range_length * 8 * (c->use_timeline ? os->ctx->streams[0]->time_base.den : AV_TIME_BASE) / duration;
if (bitrate >= 0)
os->bit_rate = bitrate;
}
Expand Down

0 comments on commit 2a9ffd8

Please sign in to comment.