Used picture_NewFromFormat when appropriate.
authorLaurent Aimar <fenrir@videolan.org>
Tue, 15 Dec 2009 18:58:51 +0000 (19:58 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 16 Dec 2009 21:00:46 +0000 (22:00 +0100)
src/misc/filter_chain.c
src/misc/image.c
src/video_output/vout_subpictures.c

index 1bf9ec2..87f3fee 100644 (file)
@@ -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;
index a3eb339..70ff48c 100644 (file)
@@ -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 )
index efc6b56..58680f2 100644 (file)
@@ -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 )
 {