diff --git a/src/amd/vpelib/src/core/inc/vpe_assert.h b/src/amd/vpelib/src/core/inc/vpe_assert.h index df67d3ce6bd..67e29e98238 100644 --- a/src/amd/vpelib/src/core/inc/vpe_assert.h +++ b/src/amd/vpelib/src/core/inc/vpe_assert.h @@ -29,6 +29,7 @@ extern "C" { #endif #include +#include // for exit() #if defined(_WIN32) @@ -43,8 +44,10 @@ extern "C" { #ifdef _DEBUG #define VPE_ASSERT(_expr) assert(_expr) +#define VPE_EXIT(_expr) exit(_expr) #else #define VPE_ASSERT(_expr) ((void)0) +#define VPE_EXIT(_expr) ((void)0) #endif #ifdef __cplusplus diff --git a/src/amd/vpelib/src/core/vpelib.c b/src/amd/vpelib/src/core/vpelib.c index 22de4f89c0a..5532d415050 100644 --- a/src/amd/vpelib/src/core/vpelib.c +++ b/src/amd/vpelib/src/core/vpelib.c @@ -663,8 +663,10 @@ enum vpe_status vpe_check_support( status = vpe_validate_geometric_scaling_support(param); } - if (vpe_priv->init.debug.assert_when_not_support) - VPE_ASSERT(status == VPE_STATUS_OK); + if (vpe_priv->init.debug.assert_when_not_support && status != VPE_STATUS_OK) { + vpe_log("vpe_check_support failed with status %d\n", (int)status); + VPE_EXIT(1); + } vpe_event(VPE_EVENT_CHECK_SUPPORT, vpe_priv->num_streams, param->target_rect.width, param->target_rect.height, status); @@ -900,8 +902,10 @@ enum vpe_status vpe_build_commands( vpe_priv->ops_support = false; - if (vpe_priv->init.debug.assert_when_not_support) - VPE_ASSERT(status == VPE_STATUS_OK); + if (vpe_priv->init.debug.assert_when_not_support && status != VPE_STATUS_OK) { + vpe_log("vpe_check_support failed with status %d\n", (int)status); + VPE_EXIT(1); + } return status; }