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

VAAPI spu: do not leak sys->spu on close.

parent 33a8caa7
......@@ -634,7 +634,10 @@ void CloseVaapiGLX(vlc_object_t *obj)
/* Cleanup cache */
if (sys->spu)
{
vlc_va_spu_cache_Delete(va, sys->spu);
sys->spu = NULL;
}
/* Cleanup VAAPI resources and connection */
if (va)
......
......@@ -707,7 +707,9 @@ spu_cache_t *vlc_va_spu_cache_Prepare(vlc_object_t *obj, vlc_va_conn_t *va, VAIm
cache->i_start = subpicture->i_start;
cache->i_stop = subpicture->i_stop;
#ifdef VAAPI_DEBUG
int i_sub = 0;
#endif
subpicture_region_t *region;
for (region = subpicture->p_region; region != NULL; region = region->p_next)
{
......@@ -726,12 +728,11 @@ spu_cache_t *vlc_va_spu_cache_Prepare(vlc_object_t *obj, vlc_va_conn_t *va, VAIm
#ifdef VAAPI_DEBUG
msg_Dbg(obj, "+ %d: subid %d", i_sub, vasub_cache->i_id);
i_sub++;
#endif
vlc_array_append(&cache->subpictures, (void *)vasub_cache);
vasub_cache = NULL;
i_sub++;
}
/* remember what was created, so it can be released in DisplayPicture() */
......@@ -860,4 +861,5 @@ void vlc_va_spu_cache_Delete(vlc_va_conn_t *va, vlc_va_spu_cache_t *restrict spu
vlc_mutex_unlock(&spu->lock);
vlc_mutex_destroy(&spu->lock);
free(spu);
}
......@@ -358,7 +358,10 @@ void CloseVaapiXCB(vlc_object_t *obj)
/* Cleanup cache */
if (sys->spu)
{
vlc_va_spu_cache_Delete(va, sys->spu);
sys->spu = NULL;
}
/* */
if (va)
......
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