[vlc-devel] commit: Used picture_NewFromFormat when appropriate. (Laurent Aimar )

git version control git at videolan.org
Wed Dec 16 22:01:25 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Dec 15 19:58:51 2009 +0100| [24c96490ebea5843e389de91b87670b408b3267c] | committer: Laurent Aimar 

Used picture_NewFromFormat when appropriate.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=24c96490ebea5843e389de91b87670b408b3267c
---

 src/misc/filter_chain.c             |    4 +---
 src/misc/image.c                    |    5 +----
 src/video_output/vout_subpictures.c |    6 ++----
 3 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 1bf9ec2..87f3fee 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -504,9 +504,7 @@ static picture_t *VideoBufferNew( filter_t *p_filter )
 {
     const video_format_t *p_fmt = &p_filter->fmt_out.video;
 
-    picture_t *p_picture = picture_New( p_fmt->i_chroma,
-                                        p_fmt->i_width, p_fmt->i_height,
-                                        p_fmt->i_aspect );
+    picture_t *p_picture = picture_NewFromFormat( p_fmt );
     if( !p_picture )
         msg_Err( p_filter, "Failed to allocate picture" );
     return p_picture;
diff --git a/src/misc/image.c b/src/misc/image.c
index a3eb339..70ff48c 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -616,10 +616,7 @@ vlc_fourcc_t image_Mime2Fourcc( const char *psz_mime )
 static picture_t *video_new_buffer( decoder_t *p_dec )
 {
     p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
-    return picture_New( p_dec->fmt_out.video.i_chroma,
-                        p_dec->fmt_out.video.i_width,
-                        p_dec->fmt_out.video.i_height,
-                        p_dec->fmt_out.video.i_aspect );
+    return picture_NewFromFormat( &p_dec->fmt_out.video );
 }
 
 static void video_del_buffer( decoder_t *p_dec, picture_t *p_pic )
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index efc6b56..58680f2 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -822,8 +822,7 @@ subpicture_region_t *subpicture_region_New( const video_format_t *p_fmt )
     if( p_fmt->i_chroma == VLC_CODEC_TEXT )
         return p_region;
 
-    p_region->p_picture = picture_New( p_fmt->i_chroma, p_fmt->i_width, p_fmt->i_height,
-                                       p_fmt->i_aspect );
+    p_region->p_picture = picture_NewFromFormat( p_fmt );
     if( !p_region->p_picture )
     {
         free( p_fmt->p_palette );
@@ -1871,8 +1870,7 @@ static picture_t *spu_new_video_buffer( filter_t *p_filter )
     const video_format_t *p_fmt = &p_filter->fmt_out.video;
 
     VLC_UNUSED(p_filter);
-    return picture_New( p_fmt->i_chroma,
-                        p_fmt->i_width, p_fmt->i_height, p_fmt->i_aspect );
+    return picture_NewFromFormat( p_fmt );
 }
 static void spu_del_video_buffer( filter_t *p_filter, picture_t *p_picture )
 {




More information about the vlc-devel mailing list