diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dv/gstdvdec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/dv/gstdvdec.c b/ext/dv/gstdvdec.c index ea891585..19bf308f 100644 --- a/ext/dv/gstdvdec.c +++ b/ext/dv/gstdvdec.c @@ -21,6 +21,7 @@ #include "config.h" #endif #include <string.h> +#include <math.h> /* First, include the header file for the plugin, to bring in the * object definition and other useful things. @@ -824,8 +825,9 @@ gst_dvdec_video_link (GstPad * pad, const GstCaps * caps) !gst_structure_get_double (structure, "framerate", &framerate)) return GST_PAD_LINK_REFUSED; - if ((height != dvdec->height) - || (framerate != dvdec->framerate / dvdec->drop_factor)) + /* allow a margin of error for the framerate caused by float rounding errors */ + if ((height != dvdec->height) || + (fabs (framerate - (dvdec->framerate / dvdec->drop_factor)) > 0.00000001)) return GST_PAD_LINK_REFUSED; if (strcmp (gst_structure_get_name (structure), "video/x-raw-rgb") == 0) { |