VPP: Remove an assert on forward temporal reference on IVB
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 13 Sep 2013 07:47:50 +0000 (15:47 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 23 Sep 2013 02:45:37 +0000 (10:45 +0800)
Add a warning and return VA_STATUS_ERROR_INVALID_PARAMETER instead

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 8a0a61ce47e086ac156602c3daaf70f20e4ca222)

src/i965_post_processing.c

index b2fa23c..e1b6032 100755 (executable)
@@ -3639,13 +3639,18 @@ gen7_pp_nv12_dndi_initialize(VADriverContextP ctx, struct i965_post_processing_c
     } else if (di_filter_param->algorithm == VAProcDeinterlacingMotionAdaptive) {
         if (pp_dndi_context->frame_order == 0) {
             VAProcPipelineParameterBuffer *pipeline_param = pp_context->pipeline_param;
-            assert(pipeline_param->num_forward_references == 1);
-            assert(pipeline_param->forward_references[0] != VA_INVALID_ID);
+            if (!pipeline_param ||
+                !pipeline_param->num_forward_references ||
+                pipeline_param->forward_references[0] == VA_INVALID_ID) {
+                WARN_ONCE("A forward temporal reference is needed for Motion adaptive deinterlacing !!!\n");
 
-            previous_in_obj_surface = SURFACE(pipeline_param->forward_references[0]);
-            assert(previous_in_obj_surface && previous_in_obj_surface->bo);
+                return VA_STATUS_ERROR_INVALID_PARAMETER;
+            } else {
+                previous_in_obj_surface = SURFACE(pipeline_param->forward_references[0]);
+                assert(previous_in_obj_surface && previous_in_obj_surface->bo);
 
-            is_first_frame = 0;
+                is_first_frame = 0;
+            }
         } else if (pp_dndi_context->frame_order == 1) {
             vpp_surface_convert(ctx,
                                 pp_dndi_context->current_out_obj_surface,