[vlc-devel] [PATCH] picture_Export: Fill visible_width & visible_height
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Wed Jun 10 16:02:56 CEST 2020
On Wed, Jun 10, 2020, at 3:50 PM, Steve Lhomme wrote:
> 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
> >
It's much more readable indeed, fixed locally
--
Hugo Beauzée-Luyssen
hugo at beauzee.fr
More information about the vlc-devel
mailing list