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

VAAPI-X11: cleanup Render() function a bit.

parent 5042a545
......@@ -1227,7 +1227,6 @@ cleanup:
/* Cannot reuse this cached subpicture */
msg_Warn(vd, "cannot reuse cached subpicture %d for surface %d -- resetting",
cache->i_id, surface->i_id);
sys->render.prev_subpicture = NULL;
vlc_mutex_unlock(&sys->cache_lock);
return VLC_EGENERIC;
}
......@@ -1258,36 +1257,35 @@ static void Render(vout_display_t *vd, picture_t *picture, subpicture_t *subpict
if (i_region == 0)
return;
again:
/* same as previous subpicture? */
if ((sys->render.prev_subpicture == subpicture) &&
(sys->render.i_cache > 0))
{
if (RenderCachedSubpictures(vd, picture, subpicture) != VLC_SUCCESS)
goto again;
if (RenderCachedSubpictures(vd, picture, subpicture) == VLC_SUCCESS)
return;
}
else
{
/* Release exra reference */
if (sys->render.i_cache > 0)
{
vlc_mutex_lock(&sys->cache_lock);
cache_SubpictureRelease(vd, sys->render.i_cache);
vlc_mutex_unlock(&sys->cache_lock);
}
/* render new subpicture */
if (RenderDirectSubpicture(vd, picture, subpicture) != VLC_SUCCESS)
return;
sys->render.prev_subpicture = subpicture;
sys->render.i_start = subpicture->i_start;
sys->render.i_stop = subpicture->i_stop;
/* render new subpicture */
/* Hold extra reference */
/* Release exra reference */
if (sys->render.i_cache > 0)
{
vlc_mutex_lock(&sys->cache_lock);
cache_SubpictureHold(vd, sys->render.i_cache);
cache_SubpictureRelease(vd, sys->render.i_cache);
vlc_mutex_unlock(&sys->cache_lock);
}
if (RenderDirectSubpicture(vd, picture, subpicture) != VLC_SUCCESS)
return;
sys->render.prev_subpicture = subpicture;
sys->render.i_start = subpicture->i_start;
sys->render.i_stop = subpicture->i_stop;
/* Hold extra reference */
vlc_mutex_lock(&sys->cache_lock);
cache_SubpictureHold(vd, sys->render.i_cache);
vlc_mutex_unlock(&sys->cache_lock);
}
static void DisplayVASurface(vout_display_t *vd, picture_t *picture)
......
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