[vlc-devel] [PATCH 2/2] core: change var_InheritURational to output a vlc_rational_t

Rémi Denis-Courmont remi at remlab.net
Mon Apr 10 19:26:59 CEST 2017


Le maanantaina 10. huhtikuuta 2017, 20.23.31 EEST Rémi Denis-Courmont a 
écrit :
> Le maanantaina 10. huhtikuuta 2017, 18.07.52 EEST Steve Lhomme a écrit :
> > On Mon, Apr 10, 2017 at 5:12 PM, Rémi Denis-Courmont <remi at remlab.net>
> 
> wrote:
> > > Le maanantaina 10. huhtikuuta 2017, 8.34.54 EEST Steve Lhomme a écrit :
> > >> ---
> > >> 
> > >>  include/vlc_variables.h                  |  4 ++--
> > >>  modules/access/decklink.cpp              |  2 +-
> > >>  modules/access/imem.c                    |  4 ++--
> > >>  modules/access/timecode.c                |  3 +--
> > >>  modules/access/v4l2/video.c              |  9 ++++-----
> > >>  modules/demux/image.c                    |  4 ++--
> > >>  modules/demux/rawvid.c                   |  5 ++---
> > >>  modules/stream_out/transcode/transcode.c |  2 +-
> > >>  modules/video_filter/fps.c               |  2 +-
> > >>  src/misc/variables.c                     | 16 ++++++++--------
> > >>  src/video_output/video_output.c          |  3 +--
> > >>  test/src/misc/variables.c                | 32
> > >> 
> > >> ++++++++++++++++---------------- 12 files changed, 41 insertions(+), 45
> > >> deletions(-)
> > >> 
> > >> diff --git a/include/vlc_variables.h b/include/vlc_variables.h
> > >> index 83752b171f..59ad99367c 100644
> > >> --- a/include/vlc_variables.h
> > >> +++ b/include/vlc_variables.h
> > >> @@ -652,8 +652,8 @@ static inline void *var_InheritAddress(
> > >> vlc_object_t
> > >> *obj, const char *name ) }
> > >> 
> > >>  #define var_InheritAddress(o, n) var_InheritAddress(VLC_OBJECT(o), n)
> > >> 
> > >> -VLC_API int var_InheritURational( vlc_object_t *, unsigned *num,
> > >> unsigned
> > >> *den, const char *var ); -#define var_InheritURational(a,b,c,d)
> > >> var_InheritURational(VLC_OBJECT(a), b, c, d) +VLC_API int
> > >> var_InheritURational( vlc_object_t *, vlc_rational_t *dst, const char
> > >> *var
> > >> ); +#define var_InheritURational(a,b,d)
> > >> var_InheritURational(VLC_OBJECT(a),
> > >> b, d)
> > > 
> > > Why don´t you return the rational directly?
> > 
> > Because it does a copy every from the value in the stack to the output
> > ?
> 
> Oh noes! Copying 64 bytes, the horror!

Ahem, *bits*

If you care about structure size, maybe you should reconsider your 
video_format_t changes, or more realistically cutting on es_format_t and 
video_format_t copies.

-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list