GNOME Bugzilla – Bug 714998
d3dvideosink: force-aspect-ratio=false causes errors due to usage of uninitialised destination rectangle
Last modified: 2014-04-02 21:12:00 UTC
d3dvidesink without aspect ratio is crushed with message "6408 0A2C3618 ERROR d3dvideosink d3dhelpers.c:1778:d3d_stretch_and_copy:<d3dvideosink0> Failure calling Direct3DDevice9_StretchRect" Here is a test batch gst-launch-1.0 videotestsrc ! d3dvideosink force-aspect-ratio=false I have changed code for if (sink->force_aspect_ratio) hr = IDirect3DDevice9_StretchRect (klass->d3d.device.d3d_device, sink->d3d.surface, /* Source Surface */ &s, /* Source Surface Rect (NULL: Whole) */ back_buffer, /* Dest Surface */ &r, /* Dest Surface Rect (NULL: Whole) */ klass->d3d.device.filter_type); else hr = IDirect3DDevice9_StretchRect (klass->d3d.device.d3d_device, sink->d3d.surface, /* Source Surface */ NULL, /* Source Surface Rect (NULL: Whole) */ back_buffer, /* Dest Surface */ NULL, /* Dest Surface Rect (NULL: Whole) */ klass->d3d.device.filter_type); It works. I think for render_rect=0 (RECT)r is undefined.
This change is not completely correct. s is always valid, and r is also valid in other cases. This commit here should fix it for all cases. Thanks for reporting :) commit c84278ae04d60c407d13e5175a4fa4cdf2464324 Author: Sebastian Dröge <sebastian@centricular.com> Date: Wed Apr 2 23:08:36 2014 +0200 d3dvideosink: Only pass a dest rectangle if set, otherwise pass NULL Call with an uninitialized rectangle will cause errors. https://bugzilla.gnome.org/show_bug.cgi?id=714998