[vlc-devel] [PATCH] picture_Export: Fill visible_width & visible_height

Steve Lhomme robux4 at ycbcr.xyz
Wed Jun 10 15:50:54 CEST 2020


You may just set fmt_out.i_visible_xxx out of the if to the 
fmt_out.i_xxx values. But otherwise LGTM.

On 2020-06-10 15:34, Hugo Beauzée-Luyssen wrote:
> This is what's used to provide the thumbnails sizes through libvlc
> ---
>   src/misc/picture.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/src/misc/picture.c b/src/misc/picture.c
> index f44c9041a1..acbbe57114 100644
> --- a/src/misc/picture.c
> +++ b/src/misc/picture.c
> @@ -520,8 +520,8 @@ int picture_Export( vlc_object_t *p_obj,
>               i_crop_height = i_height;
>               i_crop_width = (float)i_crop_height * f_ar_dest;
>           }
> -        fmt_out.i_width = i_override_width;
> -        fmt_out.i_height = i_override_height;
> +        fmt_out.i_width = fmt_out.i_visible_width = i_override_width;
> +        fmt_out.i_height = fmt_out.i_visible_height = i_override_height;
>           fmt_in.i_visible_width = i_crop_width;
>           fmt_in.i_visible_height = i_crop_height;
>           fmt_in.i_x_offset += (i_width - i_crop_width) / 2;
> @@ -529,9 +529,11 @@ int picture_Export( vlc_object_t *p_obj,
>       }
>       else
>       {
> -        fmt_out.i_width  = ( i_override_width < 0 ) ?
> +        fmt_out.i_width  =
> +        fmt_out.i_visible_width = ( i_override_width < 0 ) ?
>                              i_original_width : (unsigned)i_override_width;
> -        fmt_out.i_height = ( i_override_height < 0 ) ?
> +        fmt_out.i_height =
> +        fmt_out.i_visible_height = ( i_override_height < 0 ) ?
>                              i_original_height : (unsigned)i_override_height;
>       }
>   
> -- 
> 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