summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorRodeo <[email protected]>2015-06-23 22:01:18 +0000
committerRodeo <[email protected]>2015-06-23 22:01:18 +0000
commit3c994e1c85f7d4a1a723b5ccef08cbb0fff00c7c (patch)
treede2edf92dc056ad38730736c3bcbb3381978ab84 /libhb
parenta14dcbd980fc7e75f4a66003808d306e11c609aa (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')
-rw-r--r--libhb/vadxva2.c21
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 );