diff mbox

[FFmpeg-devel,1/4] lavc/qsvenc: enable hevc coding options configuration

Message ID 20190327125147.21358-1-zhong.li@intel.com
State Accepted
Commit c745bedd18afea19e3eb75da3d094d542b02a88b
Headers show

Commit Message

Zhong Li March 27, 2019, 12:51 p.m. UTC
Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavcodec/qsvenc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 2f128597db..1d9893efbf 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -625,9 +625,10 @@  static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
 #endif
     }
 
-    // the HEVC encoder plugin currently fails if coding options
-    // are provided
-    if (avctx->codec_id != AV_CODEC_ID_HEVC) {
+    // The HEVC encoder plugin currently fails with some old libmfx version if coding options
+    // are provided. Can't find the extract libmfx version which fixed it, just enable it from
+    // V1.28 in order to keep compatibility security.
+    if ((avctx->codec_id != AV_CODEC_ID_HEVC) || QSV_RUNTIME_VERSION_ATLEAST(q->ver, 1, 28)) {
         q->extco.Header.BufferId      = MFX_EXTBUFF_CODING_OPTION;
         q->extco.Header.BufferSz      = sizeof(q->extco);