- chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_INTERLEAVED, type); // Add a copy where we'll only be using the Y component.
+
+ // If we're using zerocopy video encoding (so the destination
+ // Y texture is owned by VA-API and will be unavailable for
+ // display), add a copy, where we'll only be using the Y component.
+ if (global_flags.use_zerocopy) {
+ chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_INTERLEAVED, type); // Add a copy where we'll only be using the Y component.
+ }