shithub: dav1d

Download patch

ref: 12a64ec7a0f6be0315e5e4036d0c4608038846c6
parent: a1e7a329b2f87154f97630403a2708030447b6ae
author: Niklas Haas <git@haasn.xyz>
date: Tue May 26 07:50:47 EDT 2020

dav1dplay: use new pl_chroma_location API

This one correctly sets the subsampling mode based on whether or not the
plane is actually subsampled, and also infers PL_CHROMA_UNKNOWN as
PL_CHROMA_TOP_LEFT in such cases.

--- a/examples/dp_renderer_placebo.c
+++ b/examples/dp_renderer_placebo.c
@@ -572,8 +572,12 @@
     }
 
     // Apply the correct chroma plane shift. This has to be done after pl_upload_plane
+#if PL_API_VER >= 67
+    pl_image_set_chroma_location(image, chroma_loc);
+#else
     pl_chroma_location_offset(chroma_loc, &image->planes[1].shift_x, &image->planes[1].shift_y);
     pl_chroma_location_offset(chroma_loc, &image->planes[2].shift_x, &image->planes[2].shift_y);
+#endif
 
     if (!ok) {
         fprintf(stderr, "Failed uploading planes!\n");