Commit c4da95eb authored by Jean-Paul Saman's avatar Jean-Paul Saman

codec/avcodec/vaapi_x11.c: Cleanup

Simplify check for valid surface and chroma.
parent df3cbd54
......@@ -1165,27 +1165,16 @@ static void DisplayPicture(vout_display_t *vd, picture_t *pic, subpicture_t *sub
{
vout_display_sys_t *sys = vd->sys;
if (pic->p_sys == NULL)
{
assert(pic->format.i_chroma == VLC_CODEC_VAAPI_SURFACE);
msg_Err(vd, "discarding picture without picture_sys_t information");
if (subpicture)
subpicture_Delete(subpicture);
picture_Release(pic);
return;
}
if (pic->p_sys->i_id == VA_INVALID_SURFACE)
if ((pic->p_sys == NULL) || (pic->p_sys->i_id == VA_INVALID_SURFACE))
{
assert(pic->format.i_chroma == VLC_CODEC_VAAPI_SURFACE);
msg_Err(vd, "discarding picture without surface information: %p (refcount %d, forced %s)",
pic, pic->i_refcount, pic->b_force ? "true" : "false" );
msg_Err(vd, "discarding picture without picture_sys_t information");
if (subpicture)
subpicture_Delete(subpicture);
picture_Release(pic);
return;
}
assert(pic->format.i_chroma == VLC_CODEC_VAAPI_SURFACE);
picture_sys_t *surface = pic->p_sys;
......@@ -1280,7 +1269,7 @@ static void PictureUnlock(picture_t *picture)
surface->i_refcount--;
//assert(surface->i_refcount == 0);
surface->i_refcount = 0;
//surface->i_refcount = 0;
surface->i_cache = VA_INVALID_ID;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment