diff options
author | Rodeo <[email protected]> | 2015-06-23 22:01:18 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2015-06-23 22:01:18 +0000 |
commit | 3c994e1c85f7d4a1a723b5ccef08cbb0fff00c7c (patch) | |
tree | de2edf92dc056ad38730736c3bcbb3381978ab84 /libhb/vadxva2.c | |
parent | a14dcbd980fc7e75f4a66003808d306e11c609aa (diff) |
DXVA2: check if a compatible AVHWAccel exists for the input codec.
Otherwise, disable DXVA2 support for the title.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7311 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/vadxva2.c')
-rw-r--r-- | libhb/vadxva2.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libhb/vadxva2.c b/libhb/vadxva2.c index 7ca965d3c..ff4a8151c 100644 --- a/libhb/vadxva2.c +++ b/libhb/vadxva2.c @@ -671,10 +671,23 @@ hb_va_dxva2_t * hb_va_create_dxva2( hb_va_dxva2_t *dxva2, int codec_id ) goto error; } - dxva->do_job = HB_WORK_OK; - dxva->description = "DXVA2"; - - return dxva; + /* + * We may get a valid DXVA2 decoder later on, but we won't be able to + * use it if libavcodec is built without support for the appropriate + * AVHWaccel, so we need to check for it before declaring victory. + */ + AVHWAccel *hwaccel = NULL; + for (hwaccel = av_hwaccel_next(NULL); + hwaccel != NULL; + hwaccel = av_hwaccel_next(hwaccel)) + { + if (hwaccel->id == codec_id && hwaccel->pix_fmt == AV_PIX_FMT_DXVA2_VLD) + { + dxva->do_job = HB_WORK_OK; + dxva->description = "DXVA2"; + return dxva; + } + } error: hb_va_close( dxva ); |