[vlc-devel] [PATCH 1/2] misc: spu: add subpicture_region_NewInternal
Thomas Guillem
thomas at gllm.fr
Wed Jun 5 09:54:58 CEST 2019
This function won't allocate the picture associated with the region.
---
src/misc/subpicture.c | 12 +++++++++++-
src/misc/subpicture.h | 2 ++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/misc/subpicture.c b/src/misc/subpicture.c
index 3e2535492a..b78698db5b 100644
--- a/src/misc/subpicture.c
+++ b/src/misc/subpicture.c
@@ -202,7 +202,7 @@ void subpicture_region_private_Delete( subpicture_region_private_t *p_private )
free( p_private );
}
-subpicture_region_t *subpicture_region_New( const video_format_t *p_fmt )
+subpicture_region_t * subpicture_region_NewInternal( const video_format_t *p_fmt )
{
subpicture_region_t *p_region = calloc( 1, sizeof(*p_region ) );
if( !p_region )
@@ -234,6 +234,16 @@ subpicture_region_t *subpicture_region_New( const video_format_t *p_fmt )
p_region->i_alpha = 0xff;
p_region->b_balanced_text = true;
+ return p_region;
+}
+
+subpicture_region_t *subpicture_region_New( const video_format_t *p_fmt )
+{
+ subpicture_region_t *p_region =
+ subpicture_region_NewInternal( p_fmt );
+ if( !p_region )
+ return NULL;
+
if( p_fmt->i_chroma == VLC_CODEC_TEXT )
return p_region;
diff --git a/src/misc/subpicture.h b/src/misc/subpicture.h
index cc051c007b..912a28af46 100644
--- a/src/misc/subpicture.h
+++ b/src/misc/subpicture.h
@@ -25,6 +25,8 @@ struct subpicture_region_private_t {
picture_t *p_picture;
};
+subpicture_region_t * subpicture_region_NewInternal( const video_format_t *p_fmt );
+
subpicture_region_private_t *subpicture_region_private_New(video_format_t *);
void subpicture_region_private_Delete(subpicture_region_private_t *);
--
2.20.1
More information about the vlc-devel
mailing list