03.02.15 13:06, Maksym Veremeyenko написав(ла):
[...]
PS

there are other places where returned value of mlt_frame_get_alpha_mask
been checked for NULL, like:


filter_rescale.c:

<------>uint8_t *input = mlt_frame_get_alpha_mask( frame );

<------>if ( input != NULL )
<------>{
<------><------>


filter_avcolour_space.c:

<------><------><------>uint8_t *alpha = mlt_frame_get_alpha_mask( frame );
<------><------><------>mlt_properties_get_data( properties, "alpha",
&alpha_size );

<------><------><------>if ( alpha && alpha_size >= len )

should we use mlt_frame_get_alpha there instead of
mlt_frame_get_alpha_mask in next rework steps?


i also attached patch that start using mlt_frame_get_alpha for some cases...

--
________________________________________
Maksym Veremeyenko
>From 566675370e08a3dc9450388f26edf154851d2133 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1.tv>
Date: Tue, 3 Feb 2015 17:41:09 +0200
Subject: [PATCH] extend mlt_frame_get_alpha usage instead of
 mlt_frame_get_alpha_mask

---
 src/modules/avformat/filter_avcolour_space.c |    2 +-
 src/modules/avformat/filter_swscale.c        |    2 +-
 src/modules/core/filter_crop.c               |    2 +-
 src/modules/core/filter_rescale.c            |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/modules/avformat/filter_avcolour_space.c b/src/modules/avformat/filter_avcolour_space.c
index 4102f5a..f70fd08 100644
--- a/src/modules/avformat/filter_avcolour_space.c
+++ b/src/modules/avformat/filter_avcolour_space.c
@@ -225,7 +225,7 @@ static int convert_image( mlt_frame frame, uint8_t **image, mlt_image_format *fo
 		{
 			register int len = width * height;
 			int alpha_size = 0;
-			uint8_t *alpha = mlt_frame_get_alpha_mask( frame );
+			uint8_t *alpha = mlt_frame_get_alpha( frame );
 			mlt_properties_get_data( properties, "alpha", &alpha_size );
 
 			if ( alpha && alpha_size >= len )
diff --git a/src/modules/avformat/filter_swscale.c b/src/modules/avformat/filter_swscale.c
index 41b09d5..b8213a3 100644
--- a/src/modules/avformat/filter_swscale.c
+++ b/src/modules/avformat/filter_swscale.c
@@ -145,7 +145,7 @@ static int filter_scale( mlt_frame frame, uint8_t **image, mlt_image_format *for
 		if ( alpha_size > 0 && alpha_size != ( owidth * oheight ) )
 		{
 			// Create the context and output image
-			uint8_t *alpha = mlt_frame_get_alpha_mask( frame );
+			uint8_t *alpha = mlt_frame_get_alpha( frame );
 			if ( alpha )
 			{
 				avformat = PIX_FMT_GRAY8;
diff --git a/src/modules/core/filter_crop.c b/src/modules/core/filter_crop.c
index caf5bef..92bf646 100644
--- a/src/modules/core/filter_crop.c
+++ b/src/modules/core/filter_crop.c
@@ -112,7 +112,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
 		}
 
 		// We should resize the alpha too
-		uint8_t *alpha = mlt_frame_get_alpha_mask( frame );
+		uint8_t *alpha = mlt_frame_get_alpha( frame );
 		int alpha_size = 0;
 		mlt_properties_get_data( properties, "alpha", &alpha_size );
 		if ( alpha && alpha_size >= ( *width * *height ) )
diff --git a/src/modules/core/filter_rescale.c b/src/modules/core/filter_rescale.c
index d0ada32..e15135d 100644
--- a/src/modules/core/filter_rescale.c
+++ b/src/modules/core/filter_rescale.c
@@ -113,7 +113,7 @@ static void scale_alpha( mlt_frame frame, int iwidth, int iheight, int owidth, i
 {
 	// Scale the alpha
 	uint8_t *output = NULL;
-	uint8_t *input = mlt_frame_get_alpha_mask( frame );
+	uint8_t *input = mlt_frame_get_alpha( frame );
 
 	if ( input != NULL )
 	{
-- 
1.7.7.6

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to