[vlc-devel] [PATCH] aout/coreaudio: Use symbols directly instead of dlsym
Thomas Guillem
thomas at gllm.fr
Fri Aug 2 14:26:19 CEST 2019
On Fri, Aug 2, 2019, at 14:25, Marvin Scholz wrote:
>
>
> On 2 Aug 2019, at 14:01, Thomas Guillem wrote:
>
> > On Fri, Aug 2, 2019, at 13:59, Marvin Scholz wrote:
> >> It is not needed to load the symbols using dlsym here, they will be
> >> automatically available if the OS version is recent enough or NULL if
> >> not.
> >> ---
> >> modules/audio_output/coreaudio_common.c | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/modules/audio_output/coreaudio_common.c
> >> b/modules/audio_output/coreaudio_common.c
> >> index 3a9ec69113..836a5f6de4 100644
> >> --- a/modules/audio_output/coreaudio_common.c
> >> +++ b/modules/audio_output/coreaudio_common.c
> >> @@ -63,10 +63,10 @@ ca_ClearOutBuffers(audio_output_t *p_aout)
> >> static void
> >> ca_init_once(void)
> >> {
> >> - unfair_lock.lock = dlsym(RTLD_DEFAULT, "os_unfair_lock_lock");
> >> + unfair_lock.lock = os_unfair_lock_lock;
> >> if (!unfair_lock.lock)
> >> return;
> >> - unfair_lock.unlock = dlsym(RTLD_DEFAULT,
> >> "os_unfair_lock_unlock");
> >> + unfair_lock.unlock = os_unfair_lock_unlock;
> >
> > OK for me.
> > By the way, do we still need that for VLC 4.0, that need a more recent
> > macOS/iOS ?
>
> Yes, we target macOS 10.11 and iOS 9.0 afaik, the unfair lock is
> available since
> macOS 10.12 and iOS 10.0.
Fair enough, LGTM.
>
> >
> >> if (!unfair_lock.unlock)
> >> unfair_lock.lock = NULL;
> >>
> >> --
> >> 2.19.1
> >>
> >> _______________________________________________
> >> vlc-devel mailing list
> >> To unsubscribe or modify your subscription options:
> >> https://mailman.videolan.org/listinfo/vlc-devel
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> 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