mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/utils: Do not compute the bitrate from duration == 0
Fixes division by 0 in fate-acodec-ra144 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
6085d6b2ae
commit
635b2ec5f2
|
@ -2529,7 +2529,7 @@ 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 != AV_NOPTS_VALUE) {
|
||||
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration > 0) {
|
||||
/* compute the bitrate */
|
||||
double bitrate = (double) filesize * 8.0 * AV_TIME_BASE /
|
||||
(double) ic->duration;
|
||||
|
|
Loading…
Reference in New Issue