diff mbox series

[FFmpeg-devel] avformat/utils fix calculating wrong bitrate on HLS, DASH stream

Message ID 20200717075317.674563-1-dongwon.kim@sk.com
State New
Headers show
Series [FFmpeg-devel] avformat/utils fix calculating wrong bitrate on HLS, DASH stream
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Dongwon Kim July 17, 2020, 7:53 a.m. UTC
Signed-off-by: Dongwon Kim <dongwon.kim@sk.com>
---
 libavformat/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 807d9f10cb..e90467e2e0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2715,7 +2715,8 @@  static void update_stream_timings(AVFormatContext *ic)
     if (duration != INT64_MIN && duration > 0 && ic->duration == AV_NOPTS_VALUE) {
         ic->duration = duration;
     }
-    if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration > 0) {
+    if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration > 0
+            && strcmp(ic->iformat->name, "hls") && strcmp(ic->iformat->name, "dash")) {
         /* compute the bitrate */
         double bitrate = (double) filesize * 8.0 * AV_TIME_BASE /
                          (double) ic->duration;