diff --git a/debian/patches/0017-backport-fixes-for-vaapi-from-upstream.patch b/debian/patches/0017-backport-fixes-for-vaapi-from-upstream.patch index d222e98e4..a5d44f6ed 100644 --- a/debian/patches/0017-backport-fixes-for-vaapi-from-upstream.patch +++ b/debian/patches/0017-backport-fixes-for-vaapi-from-upstream.patch @@ -1,3 +1,31 @@ +Index: FFmpeg/libavutil/hwcontext_vaapi.c +=================================================================== +--- FFmpeg.orig/libavutil/hwcontext_vaapi.c ++++ FFmpeg/libavutil/hwcontext_vaapi.c +@@ -1813,6 +1813,7 @@ static int vaapi_device_create(AVHWDevic + "Failed to get DRM device info for device %d.\n", n); + close(priv->drm_fd); + priv->drm_fd = -1; ++ drmFreeVersion(info); + continue; + } + +@@ -1824,6 +1825,7 @@ static int vaapi_device_create(AVHWDevic + drmFreeDevice(&device); + close(priv->drm_fd); + priv->drm_fd = -1; ++ drmFreeVersion(info); + continue; + } + av_log(ctx, AV_LOG_VERBOSE, "Trying to use " +@@ -1831,6 +1833,7 @@ static int vaapi_device_create(AVHWDevic + "with matching vendor id (%s).\n", + n, vendor_id->value); + drmFreeDevice(&device); ++ drmFreeVersion(info); + break; + } + drmFreeVersion(info); Index: FFmpeg/libavcodec/vaapi_encode.c =================================================================== --- FFmpeg.orig/libavcodec/vaapi_encode.c diff --git a/debian/patches/0018-backport-fixes-for-qsv-from-upstream.patch b/debian/patches/0018-backport-fixes-for-qsv-from-upstream.patch index 652dd86d9..548e5aa69 100644 --- a/debian/patches/0018-backport-fixes-for-qsv-from-upstream.patch +++ b/debian/patches/0018-backport-fixes-for-qsv-from-upstream.patch @@ -1,3 +1,29 @@ +Index: FFmpeg/libavcodec/qsvdec.c +=================================================================== +--- FFmpeg.orig/libavcodec/qsvdec.c ++++ FFmpeg/libavcodec/qsvdec.c +@@ -202,6 +202,7 @@ static int qsv_init_session(AVCodecConte + MFXClose(q->internal_qs.session); + q->internal_qs.session = NULL; + } ++ ff_refstruct_unref(&q->frames_ctx.mids); + av_buffer_unref(&q->frames_ctx.hw_frames_ctx); + + q->frames_ctx.hw_frames_ctx = av_buffer_ref(hw_frames_ref); +Index: FFmpeg/libavcodec/qsvenc.c +=================================================================== +--- FFmpeg.orig/libavcodec/qsvenc.c ++++ FFmpeg/libavcodec/qsvenc.c +@@ -1842,6 +1842,9 @@ int ff_qsv_enc_init(AVCodecContext *avct + return ret; + } + ++ // Update AVCodecContext with actual encoding parameters ++ avctx->has_b_frames = q->param.mfx.GopRefDist > 1 ? q->param.mfx.GopRefDist - 1 : 0; ++ + q->avctx = avctx; + + return 0; Index: FFmpeg/libavfilter/qsvvpp.c =================================================================== --- FFmpeg.orig/libavfilter/qsvvpp.c