From a14dcbd980fc7e75f4a66003808d306e11c609aa Mon Sep 17 00:00:00 2001 From: Rodeo Date: Tue, 23 Jun 2015 17:09:34 +0000 Subject: DXVA2: cleanup decode support checks. This should fix https://forum.handbrake.fr/viewtopic.php?f=11&t=32520 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7310 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/work.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'libhb/work.c') diff --git a/libhb/work.c b/libhb/work.c index 2ac218d27..3d158862b 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -300,6 +300,13 @@ void hb_display_job_info(hb_job_t *job) hb_qsv_decode_get_codec_name(title->video_codec_param)); } else +#endif +#ifdef USE_HWD + if (hb_hwd_enabled(job->h)) + { + hb_log(" + decoder: %s (dxva2)", title->video_codec_name); + } + else #endif { hb_log(" + decoder: %s", title->video_codec_name); @@ -909,6 +916,23 @@ static void do_job(hb_job_t *job) } #endif +#ifdef USE_HWD + /* + * Check support for and enable DXVA2-accelerated when applicable; we need: + * - a compatible input bitstream (HB_DECODE_SUPPORT_DXVA2) + * - DXVA2-accelerated decoding enabled (job->use_hwd) + * - an AVFormatContext (title->opaque_priv) for now + */ + if (title->video_decode_support & HB_DECODE_SUPPORT_DXVA2) + { + hb_hwd_set_enable(job->h, job->use_hwd && title->opaque_priv != NULL); + } + else +#endif + { + hb_hwd_set_enable(job->h, 0); + } + // Filters have an effect on settings. // So initialize the filters and update the job. if( job->list_filter && hb_list_count( job->list_filter ) ) @@ -920,9 +944,6 @@ static void do_job(hb_job_t *job) init.geometry.width = title->geometry.width; init.geometry.height = title->geometry.height; - /* DXVA2 */ - init.use_dxva = hb_use_dxva(title); - init.geometry.par = job->par; memcpy(init.crop, title->crop, sizeof(int[4])); init.vrate = title->vrate; -- cgit v1.2.3