Skip to content

check-va-api: Don't claim to have provided a reference frame

Simon McVittie requested to merge wip/mesa9751 into main
  • check-va-api: Don't claim to have provided a reference frame

    We're decoding a single frame, so there is no previous frame that we could possibly refer to; and our single frame is an i-frame (keyframe), so we don't need a reference anyway.

    When Mesa is compiled with assertions enabled, if num_ref_frames is greater than 0, it asserts that ReferenceFrames[0] up to ReferenceFrames[num_ref_frames-1] inclusive are valid handles to reference frames. In our case, that array is zero-filled, and 0 clearly can't be a valid handle to a previous frame because we don't have any previous frames at all, causing an assertion failure and crash.

    Closes: #117 (closed) Thanks: David Rosca

  • check-va-api: Create context before trying to use it

    In principle the context is a required parameter for vaCreateBuffer(), but in practice Mesa doesn't do anything with it, not even a validity check for it not being VA_INVALID_ID. Non-Mesa drivers, like the one from Intel and the unofficial one for Nvidia hardware via nvdec and cuda, do check for this.

    Thanks: Emil Velikov


I have literally never used VA-API before, so please check my reasoning in the commit messages and don't just assume I know what I'm talking about.

Edited by Simon McVittie

Merge request reports

Loading