[vlc-commits] picture: no need to setup the new picture format twice
Steve Lhomme
git at videolan.org
Wed Sep 19 12:15:05 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Sep 17 10:40:28 2018 +0200| [2054d46ba29d7986d8403656170ff9445ab18efc] | committer: Steve Lhomme
picture: no need to setup the new picture format twice
It's done in picture_Setup().
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2054d46ba29d7986d8403656170ff9445ab18efc
---
src/misc/picture.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/src/misc/picture.c b/src/misc/picture.c
index b08ac56a11..63fefa4f96 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -180,19 +180,6 @@ int picture_Setup( picture_t *p_picture, const video_format_t *restrict fmt )
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 );
-
/* */
picture_priv_t *priv = malloc( sizeof (*priv) );
if( unlikely(priv == NULL) )
@@ -201,10 +188,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;
More information about the vlc-commits
mailing list