Skip to content

Remove the const_data field from Dav1dRef

Michael Bradshaw requested to merge mjbshaw/dav1d:const into master

The data and const_data fields of Dav1dRef serve similar purposes. There's no true need for two fields; one field is sufficient. This merge request removes the redundancy.

If people prefer to keep the two fields in an attempt to guard against accidentally mutating user-supplied data (e.g., a ref created with dav1d_ref_wrap, which shouldn't have its data mutated, unlike dav1d_ref_create, which is generally okay to mutate since we know we allocated it and it doesn't point to constant memory), then I'll close this merge request and create a new one that:

  1. Keeps both fields.
  2. Modifies dav1d_ref_wrap to set the data field to NULL.
  3. Modifies dav1d_ref_create to set the data field to the allocated memory block.
  4. Modifies dav1d_ref_is_writable to check that the data field is not NULL.

Merge request reports

Loading