st/vdpau: use template size as default for source_rect.
authorChristian König <deathsimple@vodafone.de>
Thu, 14 Jun 2012 15:52:20 +0000 (17:52 +0200)
committerChristian König <deathsimple@vodafone.de>
Wed, 20 Jun 2012 08:13:38 +0000 (10:13 +0200)
Fixes alignment problems with flash player.

Signed-off-by: Christian König <deathsimple@vodafone.de>
src/gallium/state_trackers/vdpau/mixer.c

index e3c9349bfc45052b33d1c35dc364a2c6ff46aeb9..81a5c2936853309aa4f1bbaf7c45ade5f9459c59 100644 (file)
@@ -216,7 +216,7 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
                                 VdpLayer const *layers)
 {
    enum vl_compositor_deinterlace deinterlace;
-   struct u_rect rect, clip;
+   struct u_rect rect, clip, *prect;
    unsigned i, layer = 0;
 
    vlVdpVideoMixer *vmixer;
@@ -281,8 +281,15 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
       pipe_mutex_unlock(vmixer->device->mutex);
       return VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE;
    };
-   vl_compositor_set_buffer_layer(&vmixer->cstate, compositor, layer, surf->video_buffer,
-                                  RectToPipe(video_source_rect, &rect), NULL, deinterlace);
+   prect = RectToPipe(video_source_rect, &rect);
+   if (!prect) {
+      rect.x0 = 0;
+      rect.y0 = 0;
+      rect.x1 = surf->templat.width;
+      rect.y1 = surf->templat.height;
+      prect = &rect;
+   }
+   vl_compositor_set_buffer_layer(&vmixer->cstate, compositor, layer, surf->video_buffer, prect, NULL, deinterlace);
    vl_compositor_set_layer_dst_area(&vmixer->cstate, layer++, RectToPipe(destination_video_rect, &rect));
 
    for (i = 0; i < layer_count; ++i) {