| 736 | } |
| 737 | |
| 738 | int ff_vaapi_decode_uninit(AVCodecContext *avctx) |
| 739 | { |
| 740 | VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data; |
| 741 | VAStatus vas; |
| 742 | |
| 743 | if (ctx->va_context != VA_INVALID_ID) { |
| 744 | vas = vaDestroyContext(ctx->hwctx->display, ctx->va_context); |
| 745 | if (vas != VA_STATUS_SUCCESS) { |
| 746 | av_log(avctx, AV_LOG_ERROR, "Failed to destroy decode " |
| 747 | "context %#x: %d (%s).\n", |
| 748 | ctx->va_context, vas, vaErrorStr(vas)); |
| 749 | } |
| 750 | } |
| 751 | if (ctx->va_config != VA_INVALID_ID) { |
| 752 | vas = vaDestroyConfig(ctx->hwctx->display, ctx->va_config); |
| 753 | if (vas != VA_STATUS_SUCCESS) { |
| 754 | av_log(avctx, AV_LOG_ERROR, "Failed to destroy decode " |
| 755 | "configuration %#x: %d (%s).\n", |
| 756 | ctx->va_config, vas, vaErrorStr(vas)); |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | return 0; |
| 761 | } |
no test coverage detected