aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-13 19:20:10 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-13 19:20:10 +0100
commit53496aa7f3d1b2165a198c3b96099e648963c218 (patch)
treeb9e4be83b8c168567339329bcdba8a01c627474e /libavformat/utils.c
parent609a73b6ff30fbafcd84aba35de1ff3d65e4ba8e (diff)
downloadffmpeg-53496aa7f3d1b2165a198c3b96099e648963c218.tar.gz
avformat/utils: Do not estimate the container bitrate from the streams if one video stream lacks the bitrate
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8aee511f51..3636d43bc8 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2328,6 +2328,11 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
break;
}
bit_rate += st->codec->bit_rate;
+ } else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->codec_info_nb_frames > 1) {
+ // If we have a videostream with packets but without a bitrate
+ // than consider the sum not known
+ bit_rate = 0;
+ break;
}
}
ic->bit_rate = bit_rate;