diff --git a/debian/patches/0076-alway-set-videotoolboxenc-pixel-buffer-info.patch b/debian/patches/0076-alway-set-videotoolboxenc-pixel-buffer-info.patch new file mode 100644 index 0000000000..df99d8c8bc --- /dev/null +++ b/debian/patches/0076-alway-set-videotoolboxenc-pixel-buffer-info.patch @@ -0,0 +1,31 @@ +Index: FFmpeg/libavcodec/videotoolboxenc.c +=================================================================== +--- FFmpeg.orig/libavcodec/videotoolboxenc.c ++++ FFmpeg/libavcodec/videotoolboxenc.c +@@ -1034,9 +1034,10 @@ static int create_cv_pixel_buffer_info(A + CFNumberRef width_num = NULL; + CFNumberRef height_num = NULL; + CFMutableDictionaryRef pixel_buffer_info = NULL; ++ enum AVPixelFormat pix_fmt = avctx->pix_fmt == AV_PIX_FMT_VIDEOTOOLBOX ? avctx->sw_pix_fmt : avctx->pix_fmt; + int cv_color_format; + int status = get_cv_pixel_format(avctx, +- avctx->pix_fmt, ++ pix_fmt, + avctx->color_range, + &cv_color_format, + NULL); +@@ -1687,11 +1688,9 @@ static int vtenc_configure_encoder(AVCod + kCFBooleanTrue); + } + +- if (avctx->pix_fmt != AV_PIX_FMT_VIDEOTOOLBOX) { +- status = create_cv_pixel_buffer_info(avctx, &pixel_buffer_info); +- if (status) +- goto init_cleanup; +- } ++ status = create_cv_pixel_buffer_info(avctx, &pixel_buffer_info); ++ if (status) ++ goto init_cleanup; + + vtctx->dts_delta = vtctx->has_b_frames ? -1 : 0; + diff --git a/debian/patches/series b/debian/patches/series index 28c2cdfaeb..89de7fae22 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -73,3 +73,4 @@ 0073-add-12bit-decoding-on-videotoolbox.patch 0074-fix-the-sub2video-perf-regressions.patch 0075-allow-vpl-qsv-to-init-with-the-legacy-msdk-path.patch +0076-alway-set-videotoolboxenc-pixel-buffer-info.patch