Commit bbf0e645 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

picture_pool: remove ..._Delete(), use ..._Release() directly

parent 67e74ed2
......@@ -86,7 +86,7 @@ VLC_API picture_pool_t * picture_pool_NewFromFormat(const video_format_t *,
* All pictures must already be released to the pool. The pool will then
* released them.
*/
VLC_API void picture_pool_Delete( picture_pool_t * );
VLC_API void picture_pool_Release( picture_pool_t * );
/**
* It retreives a picture_t from a pool.
......
......@@ -374,7 +374,7 @@ static void Close(vlc_object_t *p_this)
}
if (p_sys->pool)
picture_pool_Delete(p_sys->pool);
picture_pool_Release(p_sys->pool);
free(p_sys);
DeinitOmxCore();
}
......
......@@ -326,7 +326,7 @@ static void Close(filter_t *filter)
mmal_component_release(sys->component);
if (sys->picture_pool)
picture_pool_Delete(sys->picture_pool);
picture_pool_Release(sys->picture_pool);
vlc_mutex_destroy(&sys->mutex);
free(sys->pictures);
......
......@@ -348,7 +348,7 @@ static void Close(vlc_object_t *object)
mmal_component_release(sys->component);
if (sys->picture_pool)
picture_pool_Delete(sys->picture_pool);
picture_pool_Release(sys->picture_pool);
else
for (i = 0; i < sys->num_buffers; ++i)
if (sys->pictures[i])
......
......@@ -153,7 +153,7 @@ static void PoolFree(vout_display_t *vd, picture_pool_t *pool)
if (sys->current != NULL)
picture_Release(sys->current);
picture_pool_Delete(pool);
picture_pool_Release(pool);
}
static picture_pool_t *Pool(vout_display_t *vd, unsigned requested_count)
......
......@@ -159,7 +159,7 @@ static void Close(vlc_object_t *object)
vout_display_sys_t *sys = vd->sys;
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
aa_close(sys->aa_context);
free(sys);
}
......@@ -242,7 +242,7 @@ static int Control(vout_display_t *vd, int query, va_list args)
case VOUT_DISPLAY_RESET_PICTURES:
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
sys->pool = NULL;
vd->fmt.i_width = aa_imgwidth(sys->aa_context);
......
......@@ -263,7 +263,7 @@ static void Close(vlc_object_t *p_this)
vout_display_t *vd = (vout_display_t *)p_this;
vout_display_sys_t *sys = vd->sys;
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
if (sys->window)
sys->native_window.winRelease(sys->window);
dlclose(sys->p_library);
......
......@@ -300,7 +300,7 @@ static void Close(vlc_object_t *p_this)
vout_display_t *vd = (vout_display_t *)p_this;
vout_display_sys_t *sys = vd->sys;
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
if (sys->window)
sys->native_window.winRelease(sys->window);
dlclose(sys->p_library);
......
......@@ -207,7 +207,7 @@ static int Open(vlc_object_t *object)
error:
if (sys) {
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
if (sys->dither)
cucul_free_dither(sys->dither);
if (sys->dp)
......@@ -232,7 +232,7 @@ static void Close(vlc_object_t *object)
vout_display_sys_t *sys = vd->sys;
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
if (sys->dither)
cucul_free_dither(sys->dither);
caca_free_display(sys->dp);
......
......@@ -765,7 +765,7 @@ static void CloseVideo(vlc_object_t *p_this)
vout_display_sys_t *sys = vd->sys;
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
if (sys->pic_nosignal)
picture_Release(sys->pic_nosignal);
......
......@@ -173,7 +173,7 @@ static void Close(vlc_object_t *object)
vout_display_sys_t *sys = vd->sys;
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
IDirectFBSurface *primary = sys->primary;
if (primary)
......
......@@ -330,7 +330,7 @@ static void Close(vlc_object_t *object)
vout_display_sys_t *sys = vd->sys;
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
if (!sys->is_hw_accel && sys->picture)
picture_Release(sys->picture);
......
......@@ -359,7 +359,7 @@ static void Close ( vlc_object_t *object )
DosWaitThread( &sys->tid, DCWW_WAIT );
if( sys->pool )
picture_pool_Delete( sys->pool );
picture_pool_Release( sys->pool );
DosCloseEventSem( sys->ack_event );
......
......@@ -173,7 +173,7 @@ static void Close(vlc_object_t *object)
D2D_DestroyRenderTarget(vd);
if (vd->sys->pool)
picture_pool_Delete(vd->sys->pool);
picture_pool_Release(vd->sys->pool);
CommonClean(vd);
......
......@@ -1032,7 +1032,7 @@ static void Direct3DDestroyPool(vout_display_t *vd)
IDirect3DSurface9_Release(picsys->surface);
if (picsys->fallback)
picture_Release(picsys->fallback);
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
}
sys->pool = NULL;
}
......
......@@ -1273,7 +1273,7 @@ static void DirectXDestroyPool(vout_display_t *vd)
if (sys->pool) {
DirectXDestroyPictureResource(vd);
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
}
sys->pool = NULL;
}
......
......@@ -305,7 +305,7 @@ static void Clean(vout_display_t *vd)
vout_display_sys_t *sys = vd->sys;
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
sys->pool = NULL;
if (sys->off_dc)
......
......@@ -750,7 +750,7 @@ void vout_display_opengl_Delete(vout_display_opengl_t *vgl)
vlc_gl_Unlock(vgl->gl);
}
if (vgl->pool)
picture_pool_Delete(vgl->pool);
picture_pool_Release(vgl->pool);
free(vgl);
}
......
......@@ -371,7 +371,7 @@ static void Close(vlc_object_t *object)
vout_display_sys_t *sys = vd->sys;
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
if (sys->overlay) {
SDL_LockYUVOverlay(sys->overlay);
......@@ -537,7 +537,7 @@ static int Control(vout_display_t *vd, int query, va_list args)
/* */
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
sys->pool = NULL;
vout_display_PlacePicture(&sys->place, &vd->source, vd->cfg, !sys->overlay);
......
......@@ -125,7 +125,7 @@ static void Close(vlc_object_t *object)
vout_display_sys_t *sys = vd->sys;
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
free(sys);
}
......
......@@ -240,7 +240,7 @@ static void Close(vlc_object_t *object)
if (sys->cleanup)
sys->cleanup(sys->opaque);
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
free(sys);
}
......
......@@ -234,7 +234,7 @@ static void ResetPictures(vout_display_t *vd)
if (sys->pool == NULL)
return;
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
sys->pool = NULL;
}
......
......@@ -544,6 +544,6 @@ static void ResetPictures (vout_display_t *vd)
for (unsigned i = 0; i < MAX_PICTURES; i++)
xcb_shm_detach (sys->conn, sys->seg_base + i);
picture_pool_Delete (sys->pool);
picture_pool_Release (sys->pool);
sys->pool = NULL;
}
......@@ -605,7 +605,7 @@ static void Close (vlc_object_t *obj)
vout_display_sys_t *p_sys = vd->sys;
if (p_sys->pool)
picture_pool_Delete (p_sys->pool);
picture_pool_Release (p_sys->pool);
/* show the default cursor */
xcb_change_window_attributes (p_sys->conn, p_sys->embed->handle.xid, XCB_CW_CURSOR,
......
......@@ -182,7 +182,7 @@ static void Close(vlc_object_t *object)
vout_display_sys_t *sys = vd->sys;
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
fclose(sys->f);
free(sys);
}
......
......@@ -301,7 +301,7 @@ picture_fifo_Push
picture_New
picture_NewFromFormat
picture_NewFromResource
picture_pool_Delete
picture_pool_Release
picture_pool_Get
picture_pool_GetSize
picture_pool_New
......
......@@ -56,7 +56,7 @@ struct picture_pool_t {
vlc_mutex_t lock;
};
static void picture_pool_Release(picture_pool_t *pool)
void picture_pool_Release(picture_pool_t *pool)
{
bool destroy;
......@@ -231,11 +231,6 @@ error:
return NULL;
}
void picture_pool_Delete(picture_pool_t *pool)
{
picture_pool_Release(pool);
}
picture_t *picture_pool_Get(picture_pool_t *pool)
{
vlc_mutex_lock(&pool->lock);
......
......@@ -85,8 +85,8 @@ static void test(bool zombie)
for (unsigned i = 0; i < PICTURES; i++)
picture_Release(pics[i]);
picture_pool_Delete(reserve);
picture_pool_Delete(pool);
picture_pool_Release(reserve);
picture_pool_Release(pool);
if (zombie)
for (unsigned i = 0; i < PICTURES; i++)
......@@ -104,8 +104,8 @@ int main(void)
reserve = picture_pool_Reserve(pool, PICTURES / 2);
assert(reserve != NULL);
picture_pool_Delete(reserve);
picture_pool_Delete(pool);
picture_pool_Release(reserve);
picture_pool_Release(pool);
test(false);
test(true);
......
......@@ -1482,7 +1482,7 @@ static void SplitterClose(vout_display_t *vd)
video_splitter_Delete(splitter);
if (sys->pool)
picture_pool_Delete(sys->pool);
picture_pool_Release(sys->pool);
/* */
for (int i = 0; i < sys->count; i++)
......
......@@ -1185,7 +1185,7 @@ static void ThreadReset(vout_thread_t *vout)
if (vout->p->private_pool != NULL) {
count = picture_pool_GetSize(vout->p->private_pool);
picture_pool_Delete(vout->p->private_pool);
picture_pool_Release(vout->p->private_pool);
}
leaks = picture_pool_Reset(vout->p->decoder_pool);
......
......@@ -167,10 +167,10 @@ void vout_EndWrapper(vout_thread_t *vout)
assert(!sys->display.filtered);
if (sys->private_pool)
picture_pool_Delete(sys->private_pool);
picture_pool_Release(sys->private_pool);
if (sys->decoder_pool != sys->display_pool)
picture_pool_Delete(sys->decoder_pool);
picture_pool_Release(sys->decoder_pool);
}
/*****************************************************************************
......
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