st/va: clear pointers for mpeg2 quantiser matrices
authorIndrajit Das <indrajit-kumar.das@amd.com>
Wed, 10 Jan 2018 09:43:37 +0000 (15:13 +0530)
committerChristian König <christian.koenig@amd.com>
Tue, 16 Jan 2018 09:51:15 +0000 (10:51 +0100)
This is to fix VA-API issues with GStreamer and MPEG2.
Since gstreamer does not pass quantiser matrices with each frame, invalid
pointers were being passed to the driver. This patch addresses the same.

Signed-off-by: Indrajit Das <indrajit-kumar.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/va/picture.c

index 895157375a682a1044f03d8d99752410d283c5bb..23a4b524d7ba9ead7ea4be89a5d2d32b36691932 100644 (file)
@@ -57,6 +57,11 @@ vlVaBeginPicture(VADriverContextP ctx, VAContextID context_id, VASurfaceID rende
       return VA_STATUS_ERROR_INVALID_CONTEXT;
    }
 
+   if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_MPEG12) {
+      context->desc.mpeg12.intra_matrix = NULL;
+      context->desc.mpeg12.non_intra_matrix = NULL;
+   }
+
    surf = handle_table_get(drv->htab, render_target);
    mtx_unlock(&drv->mutex);
    if (!surf || !surf->buffer)