Browse Source

obs-nvenc: Fix incorrect CUDA array size allocation

Fix cuda array use 2 bytes per element instead of 4 bytes with P010 format.
Bo 7 months ago
parent
commit
ecb99e3b34
1 changed files with 1 additions and 2 deletions
  1. 1 2
      plugins/obs-nvenc/nvenc-cuda.c

+ 1 - 2
plugins/obs-nvenc/nvenc-cuda.c

@@ -118,9 +118,8 @@ static bool cuda_surface_init(struct nvenc_data *enc, struct nv_cuda_surface *nv
 			desc.Height += enc->cy / 2;
 			break;
 		case NV_ENC_BUFFER_FORMAT_YUV420_10BIT:
-			desc.Format = CU_AD_FORMAT_UNSIGNED_INT16;
+			desc.Format = CU_AD_FORMAT_UNSIGNED_INT16; // 2 bytes per element
 			desc.Height += enc->cy / 2;
-			desc.NumChannels = 2; // number of bytes per element
 			break;
 		case NV_ENC_BUFFER_FORMAT_YUV444:
 			desc.Format = CU_AD_FORMAT_UNSIGNED_INT8;