vaapi: replace error macro implementation

The current check_va_status() function could probably be argued to be
derived from the original VAAPI's patch check_status() function, thus
GPL-only. While I have my doubts that it applies to an idiom on this
level, it's better to replace it. Similar idea, different expression
equals no copyright association.

An earlier commit message promised this, but it was forgotten.
This commit is contained in:
wm4 2017-09-30 16:07:00 +02:00
parent 4516707848
commit f3512686ee
2 changed files with 3 additions and 12 deletions

View File

@ -30,15 +30,6 @@
#include <libavutil/hwcontext.h>
#include <libavutil/hwcontext_vaapi.h>
bool check_va_status(struct mp_log *log, VAStatus status, const char *msg)
{
if (status != VA_STATUS_SUCCESS) {
mp_err(log, "%s: %s\n", msg, vaErrorStr(status));
return false;
}
return true;
}
int va_get_colorspace_flag(enum mp_csp csp)
{
switch (csp) {

View File

@ -36,9 +36,9 @@ struct mp_vaapi_ctx {
void (*destroy_native_ctx)(void *native_ctx);
};
bool check_va_status(struct mp_log *log, VAStatus status, const char *msg);
#define CHECK_VA_STATUS(ctx, msg) check_va_status((ctx)->log, status, msg)
#define CHECK_VA_STATUS(ctx, msg) \
(status == VA_STATUS_SUCCESS ? true \
: (MP_ERR(ctx, "%s failed (%s)\n", msg, vaErrorStr(status)), false))
int va_get_colorspace_flag(enum mp_csp csp);