It was apparently never necessary, since FFmpeg's default behavior of avcodec_get_hw_frames_parameters() + av_hwframe_ctx_init() makes a context that exactly matches the one we constructed manually.