[vlc-commits] picture: do nothing in the default destroy callback
Rémi Denis-Courmont
git at videolan.org
Wed Dec 12 19:44:05 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 12 20:41:11 2018 +0200| [73eb44b2d0ad91de69a87dbe21b00cb33cabb870] | committer: Rémi Denis-Courmont
picture: do nothing in the default destroy callback
It was rather, err, peculiar to force free(p_sys).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=73eb44b2d0ad91de69a87dbe21b00cb33cabb870
---
include/vlc_picture_pool.h | 7 +++++++
src/misc/picture.c | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/include/vlc_picture_pool.h b/include/vlc_picture_pool.h
index 8b04370bfb..db84667672 100644
--- a/include/vlc_picture_pool.h
+++ b/include/vlc_picture_pool.h
@@ -95,6 +95,13 @@ VLC_API picture_pool_t * picture_pool_New(unsigned count,
VLC_API picture_pool_t * picture_pool_NewFromFormat(const video_format_t *fmt,
unsigned count) VLC_USED;
+
+
+VLC_API picture_pool_t *
+picture_pool_NewFromResources(const video_format_t *format,
+ const picture_resource_t *resources,
+ size_t count);
+
/**
* Releases a pool created by picture_pool_NewExtended(), picture_pool_New()
* or picture_pool_NewFromFormat().
diff --git a/src/misc/picture.c b/src/misc/picture.c
index 58aa37a120..bcab74622d 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -53,9 +53,9 @@ static void PictureDestroyContext( picture_t *p_picture )
* Destroys a picture allocated by picture_NewFromResource() but without
* a custom destruction callback.
*/
-static void picture_DestroyFromResource( picture_t *p_picture )
+static void picture_DestroyDummy( picture_t *p_picture )
{
- free( p_picture->p_sys );
+ (void) p_picture;
}
/**
@@ -235,7 +235,7 @@ picture_t *picture_NewFromResource( const video_format_t *p_fmt, const picture_r
if( p_resource->pf_destroy != NULL )
priv->gc.destroy = p_resource->pf_destroy;
else
- priv->gc.destroy = picture_DestroyFromResource;
+ priv->gc.destroy = picture_DestroyDummy;
for( int i = 0; i < p_picture->i_planes; i++ )
{
More information about the vlc-commits
mailing list