Commit f1e3b554 authored by Laurent Aimar's avatar Laurent Aimar

Used picture_New in mosaic_bridge.c

parent 0ba8129e
...@@ -625,21 +625,12 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id, ...@@ -625,21 +625,12 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
{ {
/* TODO: chroma conversion if needed */ /* TODO: chroma conversion if needed */
p_new_pic = (picture_t*)malloc( sizeof(picture_t) ); p_new_pic = picture_New( p_pic->format.i_chroma,
if( p_new_pic == NULL ) p_pic->format.i_width, p_pic->format.i_height,
{ p_sys->p_decoder->fmt_out.video.i_aspect );
msg_Err( p_stream, "image conversion failed" ); if( !p_new_pic )
continue;
}
if( vout_AllocatePicture(
p_stream, p_new_pic, p_pic->format.i_chroma,
p_pic->format.i_width, p_pic->format.i_height,
p_sys->p_decoder->fmt_out.video.i_aspect )
!= VLC_SUCCESS )
{ {
picture_Release( p_pic ); picture_Release( p_pic );
free( p_new_pic );
msg_Err( p_stream, "image allocation failed" ); msg_Err( p_stream, "image allocation failed" );
continue; continue;
} }
...@@ -796,31 +787,21 @@ static picture_t *video_new_buffer( vlc_object_t *p_this, ...@@ -796,31 +787,21 @@ static picture_t *video_new_buffer( vlc_object_t *p_this,
i = 0; i = 0;
} }
p_pic = malloc( sizeof(picture_t) );
if( !p_pic ) return NULL;
fmt_out->video.i_chroma = fmt_out->i_codec; fmt_out->video.i_chroma = fmt_out->i_codec;
if( vout_AllocatePicture( p_this, p_pic,
fmt_out->video.i_chroma,
fmt_out->video.i_width,
fmt_out->video.i_height,
fmt_out->video.i_aspect ) != VLC_SUCCESS )
{
free( p_pic );
return NULL;
}
if( !p_pic->i_planes ) p_pic = picture_New( fmt_out->video.i_chroma,
{ fmt_out->video.i_width,
free( p_pic ); fmt_out->video.i_height,
fmt_out->video.i_aspect );
if( !p_pic )
return NULL; return NULL;
}
p_pic->i_status = RESERVED_PICTURE;
p_pic->pf_release = pf_release; p_pic->pf_release = pf_release;
p_pic->i_refcount = 1; p_pic->i_refcount = 1;
p_pic->p_sys = malloc( sizeof(picture_sys_t) ); p_pic->p_sys = malloc( sizeof(picture_sys_t) );
p_pic->p_sys->p_owner = p_this; p_pic->p_sys->p_owner = p_this;
p_pic->p_sys->b_dead = false; p_pic->p_sys->b_dead = false;
p_pic->i_status = RESERVED_PICTURE;
pp_ring[i] = p_pic; pp_ring[i] = 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