Commit 46d853ba authored by Ronald S. Bultje's avatar Ronald S. Bultje

ext/ffmpeg/gstffmpegdec.c: Prevent division by zero (#155212).

Original commit message from CVS:
Reviewed by:  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_chain):
Prevent division by zero (#155212).
parent 0e41db4c
2004-10-29 Sebastien Cote <sc5@hermes.usherb.ca>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_chain):
Prevent division by zero (#155212).
2004-10-29 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_avpicture_fill):
......
......@@ -425,12 +425,15 @@ gst_ffmpegdec_chain (GstPad * pad, GstData * _data)
ffmpegdec->context->width, ffmpegdec->context->height);
/* note that ffmpeg sometimes gets the FPS wrong */
if (GST_CLOCK_TIME_IS_VALID (expected_ts)) {
if (GST_CLOCK_TIME_IS_VALID (expected_ts) &&
ffmpegdec->context->frame_rate > 0) {
GST_BUFFER_TIMESTAMP (outbuf) = expected_ts;
GST_BUFFER_DURATION (outbuf) = GST_SECOND *
ffmpegdec->context->frame_rate_base /
ffmpegdec->context->frame_rate;
expected_ts += GST_BUFFER_DURATION (outbuf);
} else {
GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (inbuf);
}
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment