Replace it with a mutex per picture_sys_t. When doing direct rendering, the picture_sys_t is refcounted between the vout and the decoder.