]> git.sesse.net Git - ffmpeg/commitdiff
avformat/dashenc: use AVStream timebase when computing missing bitrate
authorPrzemysław Sobala <przemyslaw.sobala@gmail.com>
Wed, 27 May 2020 15:07:22 +0000 (17:07 +0200)
committerKarthick J <kjeyapal@akamai.com>
Mon, 1 Jun 2020 13:28:04 +0000 (18:58 +0530)
libavformat/dashenc.c

index 0cf0df50ef05463975854f858614f24316ebe658..00a37b175d9271afc81cc0cfa4f35c10e1e59389 100644 (file)
@@ -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;
         }