After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 714998 - d3dvideosink: force-aspect-ratio=false causes errors due to usage of uninitialised destination rectangle
d3dvideosink: force-aspect-ratio=false causes errors due to usage of uninitia...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Windows
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-22 10:38 UTC by Evgeny
Modified: 2014-04-02 21:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Evgeny 2013-11-22 10:38:08 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.
Comment 1 Sebastian Dröge (slomo) 2014-04-02 21:11:15 UTC
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