[vlc-devel] [PATCH 3/3] picture: no need to setup to new picture format twice
Steve Lhomme
robux4 at ycbcr.xyz
Mon Sep 17 11:37:29 CEST 2018
On 17/09/2018 11:17, Zhao Zhili wrote:
>
>
> On 2018年09月17日 16:51, Steve Lhomme wrote:
>> It's done in picture_Setup().
>> ---
>> src/misc/picture.c | 13 +------------
>> 1 file changed, 1 insertion(+), 12 deletions(-)
>>
>> diff --git a/src/misc/picture.c b/src/misc/picture.c
>> index b08ac56a11..8f0b1a106b 100644
>> --- a/src/misc/picture.c
>> +++ b/src/misc/picture.c
>> @@ -183,16 +183,6 @@ static picture_priv_t *picture_NewPrivate(const
>> video_format_t *restrict p_fmt)
>> video_format_t fmt = *p_fmt;
>> /* It is needed to be sure all information are filled */
>> - video_format_Setup( &fmt, p_fmt->i_chroma,
>> - p_fmt->i_width, p_fmt->i_height,
>> - p_fmt->i_visible_width,
>> p_fmt->i_visible_height,
>> - p_fmt->i_sar_num, p_fmt->i_sar_den );
>> - if( p_fmt->i_x_offset < p_fmt->i_width &&
>> - p_fmt->i_y_offset < p_fmt->i_height &&
>> - p_fmt->i_visible_width > 0 && p_fmt->i_x_offset +
>> p_fmt->i_visible_width <= p_fmt->i_width &&
>> - p_fmt->i_visible_height > 0 && p_fmt->i_y_offset +
>> p_fmt->i_visible_height <= p_fmt->i_height )
>> - video_format_CopyCrop( &fmt, p_fmt );
>> -
> In my opinion the comments should be removed or updated along with the
> code.
Which comments ? The following /* Make sure the real dimensions are a
multiple of 16 */ ?
>
>> /* */
>> picture_priv_t *priv = malloc( sizeof (*priv) );
>> if( unlikely(priv == NULL) )
>> @@ -201,10 +191,9 @@ static picture_priv_t *picture_NewPrivate(const
>> video_format_t *restrict p_fmt)
>> picture_t *p_picture = &priv->picture;
>> memset( p_picture, 0, sizeof( *p_picture ) );
>> - p_picture->format = fmt;
>> /* Make sure the real dimensions are a multiple of 16 */
>> - if( picture_Setup( p_picture, &fmt ) )
>> + if( picture_Setup( p_picture, p_fmt ) )
>> {
>> free( p_picture );
>> return NULL;
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list