Commit 7d0e62b8 authored by Laurent Aimar's avatar Laurent Aimar
Browse files

Used picture_NewFromFormat when appropriate.

parent 93b2554a
......@@ -622,9 +622,7 @@ static void CloseTextRenderer( intf_thread_t *p_intf )
*****************************************************************************/
static picture_t *AllocatePicture( video_format_t *p_fmt )
{
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 )
return NULL;
......
......@@ -632,7 +632,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
fmt.i_x_offset = fmt.i_y_offset = 0;
assert( !p_region->p_picture );
p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
return VLC_EGENERIC;
p_region->fmt = fmt;
......@@ -897,7 +897,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
fmt.i_visible_height = p_region->fmt.i_visible_height;
fmt.i_x_offset = fmt.i_y_offset = 0;
p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
return VLC_EGENERIC;
p_region->fmt = fmt;
......
......@@ -1050,7 +1050,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
fmt.i_height = fmt.i_visible_height = __MIN( i_height, i_textblock_height + VERTICAL_MARGIN * 2);
fmt.i_x_offset = fmt.i_y_offset = 0;
p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
return VLC_EGENERIC;
p_region->fmt = fmt;
......
......@@ -283,7 +283,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
fmt.i_height = fmt.i_visible_height = i_height;
fmt.i_x_offset = fmt.i_y_offset = 0;
p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
return VLC_EGENERIC;
p_region->fmt = fmt;
......
......@@ -240,7 +240,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
fmt.p_palette->palette[i][3] = pi_gamma[i];
}
p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
{
free( fmt.p_palette );
......
......@@ -666,10 +666,7 @@ static picture_t *video_new_buffer( vlc_object_t *p_this,
/* */
fmt_out->video.i_chroma = fmt_out->i_codec;
return picture_New( fmt_out->video.i_chroma,
fmt_out->video.i_width,
fmt_out->video.i_height,
fmt_out->video.i_aspect );
return picture_NewFromFormat( &fmt_out->video );
}
inline static void video_del_buffer_decoder( decoder_t *p_this,
......
......@@ -96,19 +96,13 @@ static picture_t *video_new_buffer_decoder( 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 picture_t *transcode_video_filter_buffer_new( filter_t *p_filter )
{
p_filter->fmt_out.video.i_chroma = p_filter->fmt_out.i_codec;
return picture_New( p_filter->fmt_out.video.i_chroma,
p_filter->fmt_out.video.i_width,
p_filter->fmt_out.video.i_height,
p_filter->fmt_out.video.i_aspect );
return picture_NewFromFormat( &p_filter->fmt_out.video );
}
static void transcode_video_filter_buffer_del( filter_t *p_filter, picture_t *p_pic )
{
......
......@@ -114,8 +114,7 @@ static int Create( vlc_object_t *p_this )
return VLC_ENOMEM;
p_sys->b_old = false;
p_sys->p_old = picture_New( p_fmt->i_chroma,
p_fmt->i_width, p_fmt->i_height, 0 );
p_sys->p_old = picture_NewFromFormat( p_fmt );
p_sys->p_buf = calloc( p_fmt->i_width * p_fmt->i_height, sizeof(*p_sys->p_buf) );
p_sys->p_buf2 = calloc( p_fmt->i_width * p_fmt->i_height, sizeof(*p_sys->p_buf) );
......
......@@ -249,9 +249,7 @@ static void SnapshotRatio( filter_t *p_filter, picture_t *p_pic )
p_sys->i_height = p_pic->format.i_height;
}
p_sys->scene.p_pic = picture_New( p_pic->format.i_chroma,
p_pic->format.i_width, p_pic->format.i_height,
p_pic->format.i_sar_num );
p_sys->scene.p_pic = picture_NewFromFormat( &p_pic->format );
if( p_sys->scene.p_pic )
{
picture_Copy( p_sys->scene.p_pic, p_pic );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment