[vlc-devel] [PATCH]: fix regression in ImageReadUrl

Steve Lhomme robux4 at ycbcr.xyz
Wed Feb 20 13:03:48 CET 2019


Hi,

On 19/02/2019 14:11, erwan.tulou at gmail.com wrote:
> Hello,
>
>    The patch is intended to fix i_codec (within es_format_t) no longer 
> properly initialized after some recent refactoring.

The patch seems complicated for a single missing value.

Instead of the es_format_InitFromVideo() you could just set the i_codec 
to the i_chroma value. Or set the i_codec value at the same time as the 
i_chroma is set in that function.


>
>     A direct consequence was the skins2 engine no longer displaying 
> any still images.
>
> Regards
> Erwan Tulou
>
>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le 
> logiciel antivirus Avast.
> https://www.avast.com/antivirus
>
> 0001-image-fix-ImageReadUrl.patch
>
>  From 88bdf864f9b4d6c51c83933c6938c9fd5d15841f Mon Sep 17 00:00:00 2001
> From: Erwan Tulou <erwan10 at videolan.org>
> Date: Tue, 19 Feb 2019 13:08:58 +0100
> Subject: [PATCH] image: fix ImageReadUrl()
>
> i_codec (within es_format_t) was no longer properly initialized after some
> recent refactoring, therefore failing to decode any image. This accounted
> for the skins2 engine no longer able to display anything.
> ---
>   src/misc/image.c | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/src/misc/image.c b/src/misc/image.c
> index 52edd0ff67..a21b82f498 100644
> --- a/src/misc/image.c
> +++ b/src/misc/image.c
> @@ -301,22 +301,25 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
>       if( p_block == NULL )
>           goto error;
>   
> -    es_format_t fmtin;
> -    es_format_Init( &fmtin, VIDEO_ES, 0 ); /* no chroma, the MIME type of the picture will be used */
> +    video_format_t fmtvideo;
> +    video_format_Init( &fmtvideo, 0 );
>   
>       char *psz_mime = stream_MimeType( p_stream );
>       if( psz_mime != NULL )
>       {
> -        fmtin.video.i_chroma = image_Mime2Fourcc( psz_mime );
> +        fmtvideo.i_chroma = image_Mime2Fourcc( psz_mime );
>           free( psz_mime );
>       }
> -    if( !fmtin.video.i_chroma )
> +    if( !fmtvideo.i_chroma )
>       {
>          /* Try to guess format from file name */
> -       fmtin.video.i_chroma = image_Ext2Fourcc( psz_url );
> +       fmtvideo.i_chroma = image_Ext2Fourcc( psz_url );
>       }
>       vlc_stream_Delete( p_stream );
>   
> +    es_format_t fmtin;
> +    es_format_InitFromVideo( &fmtin, &fmtvideo );
> +    video_format_Clean( &fmtvideo );
>   
>       p_pic = ImageRead( p_image, p_block, &fmtin, p_fmt_out );
>   
> -- 
> 2.20.1
>
>
> _______________________________________________
> 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