]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_deinterlace_qsv.c
Merge commit 'e05e5920a4e1f1f15cc8a7c843159d519f6ec18e'
[ffmpeg] / libavfilter / vf_deinterlace_qsv.c
index 897e6bd622135f52c1da8a2fb6e0f63bc247f349..d6b02e98c5b2889edf162d64794f4cffca38e892 100644 (file)
@@ -35,6 +35,7 @@
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/time.h"
+#include "libavfilter/qsvvpp.h"
 
 #include "avfilter.h"
 #include "formats.h"
@@ -201,6 +202,11 @@ static int init_out_session(AVFilterContext *ctx)
         }
     }
 
+    if (err != MFX_ERR_NONE) {
+        av_log(ctx, AV_LOG_ERROR, "Error getting the session handle\n");
+        return AVERROR_UNKNOWN;
+    }
+
     /* create a "slave" session with those same properties, to be used for
      * actual deinterlacing */
     err = MFXInit(impl, &ver, &s->session);
@@ -215,6 +221,12 @@ static int init_out_session(AVFilterContext *ctx)
             return AVERROR_UNKNOWN;
     }
 
+    if (QSV_RUNTIME_VERSION_ATLEAST(ver, 1, 25)) {
+        err = MFXJoinSession(device_hwctx->session, s->session);
+        if (err != MFX_ERR_NONE)
+            return AVERROR_UNKNOWN;
+    }
+
     memset(&par, 0, sizeof(par));
 
     s->deint_conf.Header.BufferId = MFX_EXTBUFF_VPP_DEINTERLACING;