GNOME Bugzilla – Bug 682171
videoscale: assertion failed: (envelope ((x - (xi - 1)) * ex) == 0)
Last modified: 2013-04-13 13:07:14 UTC
"videoscale" fails when using method=3 (lanczos) and sharpness=0.0 $ gst-launch-1.0 filesrc location=MVI_5751.MOV ! decodebin ! videoscale method=3 sharpness=0.0 ! video/x-raw,height=144,pixel-aspect-ratio=1/1 ! fakesink Setting pipeline to PAUSED ... Pipeline is PREROLLING ... ** ERROR:vs_lanczos.c:316:scale1d_calculate_taps: assertion failed: (envelope ((x - (xi - 1)) * ex) == 0) Aborted (core dumped)
I've checked this out and the number of taps used by the lanczos filter explodes to infinity as the sharpness value goes to zero. At sharpness == 0.0 this causes x and xi to reach maximum negative values and results in xi overflowing, which causes the assertion to fail. At least for the lanczos filter, sharpness should not be allowed to actually reach zero. I'm not sure the best solution to mitigate this is, however.
g_param_spec_double() only allows you to define the value range inclusively, so it's not possible to express this: 0.0 < sharpness <= 2.0 http://developer.gnome.org/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#g-param-spec-double I think setting the minimum value to 0.1 or whatever makes sense would probably be a good fix. The computational impacts of using a sharpness close to zero should also be documented, considering it's asymptotic and all.
We can use DBL_MIN instead of 0.0
Okay to change this? I think it is, as setting this value would crash anyway.
commit c2b34b05de5a3fa0b12d749b89d4d655916aac49 Author: Stefan Sauer <ensonic@users.sf.net> Date: Fri Apr 5 22:03:56 2013 +0200 videoscale: set min value to DBL_MIN to avoid a value of 0.0 that would crash
Reopening, as this needs more thought. The fix is fine for now, of course.
commit c07efdabd8fcf02f100c9810a7a99a367dea4b34 Author: David Schleef <ds@schleef.org> Date: Sat Apr 6 13:00:02 2013 -0700 videoscale: set reasonable limits on properties Properties sharpen, sharpness, and envelope are only useful near their default values. Decrease ranges to avoid brokenness. https://bugzilla.gnome.org/show_bug.cgi?id=682171