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

Steve Lhomme robux4 at gmail.com
Mon Apr 10 18:07:52 CEST 2017


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
? If it was an inline function I think optimizations would be possible
but here I don't think.

On the other hand it would be more readable.

> --
> 雷米‧德尼-库尔蒙
> https://www.remlab.net/
>
> _______________________________________________
> 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