浏览代码

libobs: Fix plane heights for odd values

Kurt Kartaltepe 1 年之前
父节点
当前提交
8c71b0b586
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      libobs/media-io/video-frame.c

+ 5 - 5
libobs/media-io/video-frame.c

@@ -133,14 +133,14 @@ void video_frame_get_plane_heights(uint32_t heights[MAX_AV_PLANES],
 	case VIDEO_FORMAT_I420: /* three planes: full height, half height, half height */
 	case VIDEO_FORMAT_I420: /* three planes: full height, half height, half height */
 	case VIDEO_FORMAT_I010:
 	case VIDEO_FORMAT_I010:
 		heights[0] = height;
 		heights[0] = height;
-		heights[1] = height / 2;
-		heights[2] = height / 2;
+		heights[1] = HALF(height);
+		heights[2] = HALF(height);
 		break;
 		break;
 
 
 	case VIDEO_FORMAT_NV12: /* two planes: full height, half height */
 	case VIDEO_FORMAT_NV12: /* two planes: full height, half height */
 	case VIDEO_FORMAT_P010:
 	case VIDEO_FORMAT_P010:
 		heights[0] = height;
 		heights[0] = height;
-		heights[1] = height / 2;
+		heights[1] = HALF(height);
 		break;
 		break;
 
 
 	case VIDEO_FORMAT_Y800: /* one plane: full height */
 	case VIDEO_FORMAT_Y800: /* one plane: full height */
@@ -168,8 +168,8 @@ void video_frame_get_plane_heights(uint32_t heights[MAX_AV_PLANES],
 
 
 	case VIDEO_FORMAT_I40A: /* four planes: full height, half height, half height, full height */
 	case VIDEO_FORMAT_I40A: /* four planes: full height, half height, half height, full height */
 		heights[0] = height;
 		heights[0] = height;
-		heights[1] = height / 2;
-		heights[2] = height / 2;
+		heights[1] = HALF(height);
+		heights[2] = HALF(height);
 		heights[3] = height;
 		heights[3] = height;
 		break;
 		break;