From eb2daed2a7495f9049126a198548d68938346096 Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Thu, 28 Jan 2016 14:21:04 +0200 Subject: decoder: vp9: Fix crop rectangle setting Align with software vp9dec behaviour: Add crop rectangle only if display_width/display_height is less than the frame_hdr->width/frame_hdr->height --- gst-libs/gst/vaapi/gstvaapidecoder_vp9.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c b/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c index 055ac09b..bb13e961 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_vp9.c @@ -442,13 +442,16 @@ decode_picture (GstVaapiDecoderVp9 * decoder, const guchar * buf, if (is_clone_pic) return GST_VAAPI_DECODER_STATUS_SUCCESS; - if (frame_hdr->display_size_enabled) { - crop_width = frame_hdr->display_width; - crop_height = frame_hdr->display_height; - } else if (priv->width > frame_hdr->width || priv->height > frame_hdr->height) { + if (priv->width > frame_hdr->width || priv->height > frame_hdr->height) { crop_width = frame_hdr->width; crop_height = frame_hdr->height; } + if (frame_hdr->display_size_enabled && + (frame_hdr->width > frame_hdr->display_width + || frame_hdr->height > frame_hdr->display_height)) { + crop_width = frame_hdr->display_width; + crop_height = frame_hdr->display_height; + } if (crop_width || crop_height) { GstVaapiRectangle crop_rect; crop_rect.x = 0; -- cgit v1.2.1