mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
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).
This commit is contained in:
parent
0e41db4c65
commit
46d853ba99
2 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue