ffmpeg: don't divide by 0 when checking the framerates

Check for denom==0 first and set it to on in that case.
This commit is contained in:
Stefan Kost 2011-02-08 12:17:53 +02:00
parent 6444bd2557
commit dd7b219c42

View file

@ -204,6 +204,10 @@ gst_ff_vid_caps_new (AVCodecContext * context, enum CodecID codec_id,
num = context->time_base.den / context->ticks_per_frame;
denom = context->time_base.num;
if (!denom) {
GST_LOG ("invalid framerate: %d/0, -> %d/1", num, num);
denom = 1;
}
if (gst_util_fraction_compare (num, denom, 1000, 1) > 0) {
GST_LOG ("excessive framerate: %d/%d, -> 0/1", num, denom);
num = 0;