Message ID | 20161029152234.GV4602@nb4 |
---|---|
State | New |
Headers | show |
On 10/29/2016 11:22 AM, Michael Niedermayer wrote: > On Sat, Oct 29, 2016 at 06:35:19PM +1100, Matt Oliver wrote: >> configure | 5 +---- >> libavformat/avisynth.c | 14 +++++--------- >> 2 files changed, 6 insertions(+), 13 deletions(-) >> b1568f39504e5e14c924d27c8f11ba8f5816d68c 0003-avformat-avisynth.c-Use-new-safe-dlopen-code.patch >> From 633212cf1246b3fde61dd6515229e6a893005664 Mon Sep 17 00:00:00 2001 >> From: Matt Oliver <protogonoi@gmail.com> >> Date: Sat, 29 Oct 2016 18:25:25 +1100 >> Subject: [PATCH 3/4] avformat/avisynth.c: Use new safe dlopen code. > > breaks --enable-avisynth on linux/ubuntu > > --- config.h 2016-10-29 17:17:55.214014842 +0200 > +++ delth/config.h 2016-10-29 17:15:41.906012034 +0200 > @@ -1155,7 +1155,7 @@ > #define CONFIG_AST_DEMUXER 1 > #define CONFIG_AU_DEMUXER 1 > #define CONFIG_AVI_DEMUXER 1 > -#define CONFIG_AVISYNTH_DEMUXER 1 > +#define CONFIG_AVISYNTH_DEMUXER 0 > #define CONFIG_AVR_DEMUXER 1 > #define CONFIG_AVS_DEMUXER 1 > #define CONFIG_BETHSOFTVID_DEMUXER 1 > > [...] > Yeah, libdl needs to be linked to on non-Windows, and the check for it got removed with the rest of the 'enabled avisynth' case in configure. Just putting dlopen under avisynth_demuxer_deps doesn't seem to be sufficient for that to work.
On 30 October 2016 at 03:41, Stephen Hutchinson <qyot27@gmail.com> wrote: > On 10/29/2016 11:22 AM, Michael Niedermayer wrote: > >> On Sat, Oct 29, 2016 at 06:35:19PM +1100, Matt Oliver wrote: >> >>> configure | 5 +---- >>> libavformat/avisynth.c | 14 +++++--------- >>> 2 files changed, 6 insertions(+), 13 deletions(-) >>> b1568f39504e5e14c924d27c8f11ba8f5816d68c 0003-avformat-avisynth.c-Use-n >>> ew-safe-dlopen-code.patch >>> From 633212cf1246b3fde61dd6515229e6a893005664 Mon Sep 17 00:00:00 2001 >>> From: Matt Oliver <protogonoi@gmail.com> >>> Date: Sat, 29 Oct 2016 18:25:25 +1100 >>> Subject: [PATCH 3/4] avformat/avisynth.c: Use new safe dlopen code. >>> >> >> breaks --enable-avisynth on linux/ubuntu >> >> --- config.h 2016-10-29 17:17:55.214014842 +0200 >> +++ delth/config.h 2016-10-29 17:15:41.906012034 +0200 >> @@ -1155,7 +1155,7 @@ >> #define CONFIG_AST_DEMUXER 1 >> #define CONFIG_AU_DEMUXER 1 >> #define CONFIG_AVI_DEMUXER 1 >> -#define CONFIG_AVISYNTH_DEMUXER 1 >> +#define CONFIG_AVISYNTH_DEMUXER 0 >> #define CONFIG_AVR_DEMUXER 1 >> #define CONFIG_AVS_DEMUXER 1 >> #define CONFIG_BETHSOFTVID_DEMUXER 1 >> >> [...] >> >> > Yeah, libdl needs to be linked to on non-Windows, and the > check for it got removed with the rest of the 'enabled avisynth' > case in configure. Just putting dlopen under avisynth_demuxer_deps doesn't > seem to be sufficient for that to work. Looks like I missed a line, my apologies. Updated version attached.
On Sun, Oct 30, 2016 at 5:13 AM, Matt Oliver <protogonoi@gmail.com> wrote: > On 30 October 2016 at 03:41, Stephen Hutchinson <qyot27@gmail.com> wrote: > >> On 10/29/2016 11:22 AM, Michael Niedermayer wrote: >> >>> On Sat, Oct 29, 2016 at 06:35:19PM +1100, Matt Oliver wrote: >>> >>>> configure | 5 +---- >>>> libavformat/avisynth.c | 14 +++++--------- >>>> 2 files changed, 6 insertions(+), 13 deletions(-) >>>> b1568f39504e5e14c924d27c8f11ba8f5816d68c 0003-avformat-avisynth.c-Use-n >>>> ew-safe-dlopen-code.patch >>>> From 633212cf1246b3fde61dd6515229e6a893005664 Mon Sep 17 00:00:00 2001 >>>> From: Matt Oliver <protogonoi@gmail.com> >>>> Date: Sat, 29 Oct 2016 18:25:25 +1100 >>>> Subject: [PATCH 3/4] avformat/avisynth.c: Use new safe dlopen code. >>>> >>> >>> breaks --enable-avisynth on linux/ubuntu >>> >>> --- config.h 2016-10-29 17:17:55.214014842 +0200 >>> +++ delth/config.h 2016-10-29 17:15:41.906012034 +0200 >>> @@ -1155,7 +1155,7 @@ >>> #define CONFIG_AST_DEMUXER 1 >>> #define CONFIG_AU_DEMUXER 1 >>> #define CONFIG_AVI_DEMUXER 1 >>> -#define CONFIG_AVISYNTH_DEMUXER 1 >>> +#define CONFIG_AVISYNTH_DEMUXER 0 >>> #define CONFIG_AVR_DEMUXER 1 >>> #define CONFIG_AVS_DEMUXER 1 >>> #define CONFIG_BETHSOFTVID_DEMUXER 1 >>> >>> [...] >>> >>> >> Yeah, libdl needs to be linked to on non-Windows, and the >> check for it got removed with the rest of the 'enabled avisynth' >> case in configure. Just putting dlopen under avisynth_demuxer_deps doesn't >> seem to be sufficient for that to work. > > > Looks like I missed a line, my apologies. Updated version attached. > Looking at the configure changes - having a dependency on both dlopen and LoadLibrary sounds odd. Shouldn't it be either, not both? - Hendrik
On 30 October 2016 at 20:21, Hendrik Leppkes <h.leppkes@gmail.com> wrote: > On Sun, Oct 30, 2016 at 5:13 AM, Matt Oliver <protogonoi@gmail.com> wrote: > > On 30 October 2016 at 03:41, Stephen Hutchinson <qyot27@gmail.com> > wrote: > > > >> On 10/29/2016 11:22 AM, Michael Niedermayer wrote: > >> > >>> On Sat, Oct 29, 2016 at 06:35:19PM +1100, Matt Oliver wrote: > >>> > >>>> configure | 5 +---- > >>>> libavformat/avisynth.c | 14 +++++--------- > >>>> 2 files changed, 6 insertions(+), 13 deletions(-) > >>>> b1568f39504e5e14c924d27c8f11ba8f5816d68c > 0003-avformat-avisynth.c-Use-n > >>>> ew-safe-dlopen-code.patch > >>>> From 633212cf1246b3fde61dd6515229e6a893005664 Mon Sep 17 00:00:00 > 2001 > >>>> From: Matt Oliver <protogonoi@gmail.com> > >>>> Date: Sat, 29 Oct 2016 18:25:25 +1100 > >>>> Subject: [PATCH 3/4] avformat/avisynth.c: Use new safe dlopen code. > >>>> > >>> > >>> breaks --enable-avisynth on linux/ubuntu > >>> > >>> --- config.h 2016-10-29 17:17:55.214014842 +0200 > >>> +++ delth/config.h 2016-10-29 17:15:41.906012034 +0200 > >>> @@ -1155,7 +1155,7 @@ > >>> #define CONFIG_AST_DEMUXER 1 > >>> #define CONFIG_AU_DEMUXER 1 > >>> #define CONFIG_AVI_DEMUXER 1 > >>> -#define CONFIG_AVISYNTH_DEMUXER 1 > >>> +#define CONFIG_AVISYNTH_DEMUXER 0 > >>> #define CONFIG_AVR_DEMUXER 1 > >>> #define CONFIG_AVS_DEMUXER 1 > >>> #define CONFIG_BETHSOFTVID_DEMUXER 1 > >>> > >>> [...] > >>> > >>> > >> Yeah, libdl needs to be linked to on non-Windows, and the > >> check for it got removed with the rest of the 'enabled avisynth' > >> case in configure. Just putting dlopen under avisynth_demuxer_deps > doesn't > >> seem to be sufficient for that to work. > > > > > > Looks like I missed a line, my apologies. Updated version attached. > > > > Looking at the configure changes - having a dependency on both dlopen > and LoadLibrary sounds odd. Shouldn't it be either, not both? > Yes, unfortunately i was testing on mingw which has both. Fixed thanks.
On Sun, Oct 30, 2016 at 10:31:16PM +1100, Matt Oliver wrote: > On 30 October 2016 at 20:21, Hendrik Leppkes <h.leppkes@gmail.com> wrote: > > > On Sun, Oct 30, 2016 at 5:13 AM, Matt Oliver <protogonoi@gmail.com> wrote: > > > On 30 October 2016 at 03:41, Stephen Hutchinson <qyot27@gmail.com> > > wrote: > > > > > >> On 10/29/2016 11:22 AM, Michael Niedermayer wrote: > > >> > > >>> On Sat, Oct 29, 2016 at 06:35:19PM +1100, Matt Oliver wrote: > > >>> > > >>>> configure | 5 +---- > > >>>> libavformat/avisynth.c | 14 +++++--------- > > >>>> 2 files changed, 6 insertions(+), 13 deletions(-) > > >>>> b1568f39504e5e14c924d27c8f11ba8f5816d68c > > 0003-avformat-avisynth.c-Use-n > > >>>> ew-safe-dlopen-code.patch > > >>>> From 633212cf1246b3fde61dd6515229e6a893005664 Mon Sep 17 00:00:00 > > 2001 > > >>>> From: Matt Oliver <protogonoi@gmail.com> > > >>>> Date: Sat, 29 Oct 2016 18:25:25 +1100 > > >>>> Subject: [PATCH 3/4] avformat/avisynth.c: Use new safe dlopen code. > > >>>> > > >>> > > >>> breaks --enable-avisynth on linux/ubuntu > > >>> > > >>> --- config.h 2016-10-29 17:17:55.214014842 +0200 > > >>> +++ delth/config.h 2016-10-29 17:15:41.906012034 +0200 > > >>> @@ -1155,7 +1155,7 @@ > > >>> #define CONFIG_AST_DEMUXER 1 > > >>> #define CONFIG_AU_DEMUXER 1 > > >>> #define CONFIG_AVI_DEMUXER 1 > > >>> -#define CONFIG_AVISYNTH_DEMUXER 1 > > >>> +#define CONFIG_AVISYNTH_DEMUXER 0 > > >>> #define CONFIG_AVR_DEMUXER 1 > > >>> #define CONFIG_AVS_DEMUXER 1 > > >>> #define CONFIG_BETHSOFTVID_DEMUXER 1 > > >>> > > >>> [...] > > >>> > > >>> > > >> Yeah, libdl needs to be linked to on non-Windows, and the > > >> check for it got removed with the rest of the 'enabled avisynth' > > >> case in configure. Just putting dlopen under avisynth_demuxer_deps > > doesn't > > >> seem to be sufficient for that to work. > > > > > > > > > Looks like I missed a line, my apologies. Updated version attached. > > > > > > > Looking at the configure changes - having a dependency on both dlopen > > and LoadLibrary sounds odd. Shouldn't it be either, not both? > > > > Yes, unfortunately i was testing on mingw which has both. Fixed thanks. > configure | 5 ++--- > libavformat/avisynth.c | 14 +++++--------- > 2 files changed, 7 insertions(+), 12 deletions(-) > ed7ff2d7e0c984ee5253e76f54b3115386c1428d 0003-avformat-avisynth.c-Use-new-safe-dlopen-code.patch > From 1dc1f59158cfb12d9160ee47342f5742d67ad864 Mon Sep 17 00:00:00 2001 > From: Matt Oliver <protogonoi@gmail.com> > Date: Sun, 30 Oct 2016 15:13:47 +1100 > Subject: [PATCH] avformat/avisynth.c: Use new safe dlopen code. Works now thx [...]
On 10/30/2016 8:31 AM, Matt Oliver wrote: > From 1dc1f59158cfb12d9160ee47342f5742d67ad864 Mon Sep 17 00:00:00 2001 > From: Matt Oliver <protogonoi@gmail.com> > Date: Sun, 30 Oct 2016 15:13:47 +1100 > Subject: [PATCH] avformat/avisynth.c: Use new safe dlopen code. > > --- > configure | 5 ++--- > libavformat/avisynth.c | 14 +++++--------- > 2 files changed, 7 insertions(+), 12 deletions(-) > > diff --git a/configure b/configure > index 5993de5..9feb544 100755 > --- a/configure > +++ b/configure > @@ -2850,6 +2850,7 @@ asf_stream_muxer_select="asf_muxer" > avi_demuxer_select="iso_media riffdec exif" > avi_muxer_select="riffenc" > avisynth_demuxer_deps="avisynth" > +avisynth_demuxer_deps_any="dlopen LoadLibrary" > avisynth_demuxer_select="riffdec" With this change and the stuff removed below, avisynth (CONFIG_AVISYNTH) will always be enabled if you configure with --enable-avisynth, and only avisynth_demuxer will be disabled depending on the presence of dlopen and LoadLibrary. This is probably not intended, seeing how libavformat/Makefile checks for CONFIG_AVISYNTH and not CONFIG_AVISYNTH_DEMUXER in order to compile the source file, so you should make it avisynth_deps_any="dlopen LoadLibrary" since avisynth_demuxer already depends on avisynth. Also, consider changing libavformat/Makefile to check for the demuxer rather than the library/feature. > caf_demuxer_select="iso_media riffdec" > dash_muxer_select="mp4_muxer" > @@ -5417,6 +5418,7 @@ elif check_func dlopen -ldl && check_func dlsym -ldl; then > ldl=-ldl > fi > > +avisynth_demuxer_extralibs='$ldl' > decklink_outdev_extralibs="$decklink_outdev_extralibs $ldl" > decklink_indev_extralibs="$decklink_indev_extralibs $ldl" > frei0r_filter_extralibs='$ldl' > @@ -5664,9 +5666,6 @@ fi > enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; } > enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics || > check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; } > -enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } || > - { check_lib2 "dlfcn.h" dlopen -ldl; } || > - die "ERROR: LoadLibrary/dlopen not found for avisynth"; } > enabled cuda && { check_lib cuda.h cuInit -lcuda || > die "ERROR: CUDA not found"; } > enabled cuvid && { add_cflags -I$source_path; > diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c > index 1acc44f..514cb99 100644 > --- a/libavformat/avisynth.c > +++ b/libavformat/avisynth.c > @@ -29,7 +29,7 @@ > > /* Platform-specific directives for AviSynth vs AvxSynth. */ > #ifdef _WIN32 > - #include <windows.h> > + #include "compat/w32dlfcn.h" > #undef EXTERN_C > #include "compat/avisynth/avisynth_c.h" > #define AVISYNTH_LIB "avisynth" > @@ -39,10 +39,6 @@ > #include "compat/avisynth/avxsynth_c.h" > #define AVISYNTH_NAME "libavxsynth" > #define AVISYNTH_LIB AVISYNTH_NAME SLIBSUF > - > - #define LoadLibrary(x) dlopen(x, RTLD_NOW | RTLD_LOCAL) > - #define GetProcAddress dlsym > - #define FreeLibrary dlclose > #endif > > typedef struct AviSynthLibrary { > @@ -118,13 +114,13 @@ static av_cold void avisynth_atexit_handler(void); > > static av_cold int avisynth_load_library(void) > { > - avs_library.library = LoadLibrary(AVISYNTH_LIB); > + avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_LOCAL); > if (!avs_library.library) > return AVERROR_UNKNOWN; > > #define LOAD_AVS_FUNC(name, continue_on_fail) \ > avs_library.name = \ > - (void *)GetProcAddress(avs_library.library, #name); \ > + (void *)dlsym(avs_library.library, #name); \ > if (!continue_on_fail && !avs_library.name) \ > goto fail; > > @@ -157,7 +153,7 @@ static av_cold int avisynth_load_library(void) > return 0; > > fail: > - FreeLibrary(avs_library.library); > + dlclose(avs_library.library); > return AVERROR_UNKNOWN; > } > > @@ -225,7 +221,7 @@ static av_cold void avisynth_atexit_handler(void) > avisynth_context_destroy(avs); > avs = next; > } > - FreeLibrary(avs_library.library); > + dlclose(avs_library.library); > > avs_atexit_called = 1; > } > -- 2.10.1.windows.1
On 31 October 2016 at 05:30, James Almer <jamrial@gmail.com> wrote: > On 10/30/2016 8:31 AM, Matt Oliver wrote: > > From 1dc1f59158cfb12d9160ee47342f5742d67ad864 Mon Sep 17 00:00:00 2001 > > From: Matt Oliver <protogonoi@gmail.com> > > Date: Sun, 30 Oct 2016 15:13:47 +1100 > > Subject: [PATCH] avformat/avisynth.c: Use new safe dlopen code. > > > > --- > > configure | 5 ++--- > > libavformat/avisynth.c | 14 +++++--------- > > 2 files changed, 7 insertions(+), 12 deletions(-) > > > > diff --git a/configure b/configure > > index 5993de5..9feb544 100755 > > --- a/configure > > +++ b/configure > > @@ -2850,6 +2850,7 @@ asf_stream_muxer_select="asf_muxer" > > avi_demuxer_select="iso_media riffdec exif" > > avi_muxer_select="riffenc" > > avisynth_demuxer_deps="avisynth" > > +avisynth_demuxer_deps_any="dlopen LoadLibrary" > > avisynth_demuxer_select="riffdec" > > With this change and the stuff removed below, avisynth (CONFIG_AVISYNTH) > will always be enabled if you configure with --enable-avisynth, and only > avisynth_demuxer will be disabled depending on the presence of dlopen and > LoadLibrary. > This is probably not intended, seeing how libavformat/Makefile checks for > CONFIG_AVISYNTH and not CONFIG_AVISYNTH_DEMUXER in order to compile the > source file, so you should make it avisynth_deps_any="dlopen LoadLibrary" > since avisynth_demuxer already depends on avisynth. > > Also, consider changing libavformat/Makefile to check for the demuxer > rather than the library/feature. > Changed, I also moved the avisynth stuff up to the external libraries section of configure > > > caf_demuxer_select="iso_media riffdec" > > dash_muxer_select="mp4_muxer" > > @@ -5417,6 +5418,7 @@ elif check_func dlopen -ldl && check_func dlsym > -ldl; then > > ldl=-ldl > > fi > > > > +avisynth_demuxer_extralibs='$ldl' > > decklink_outdev_extralibs="$decklink_outdev_extralibs $ldl" > > decklink_indev_extralibs="$decklink_indev_extralibs $ldl" > > frei0r_filter_extralibs='$ldl' > > @@ -5664,9 +5666,6 @@ fi > > enabled avfoundation_indev && { check_header_objcc > AVFoundation/AVFoundation.h || disable avfoundation_indev; } > > enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h > CGGetActiveDisplayList -framework CoreGraphics || > > check_lib2 ApplicationServices/ApplicationServices.h > CGGetActiveDisplayList -framework ApplicationServices; } > > -enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } > || > > - { check_lib2 "dlfcn.h" dlopen -ldl; } || > > - die "ERROR: LoadLibrary/dlopen not found > for avisynth"; } > > enabled cuda && { check_lib cuda.h cuInit -lcuda || > > die "ERROR: CUDA not found"; } > > enabled cuvid && { add_cflags -I$source_path; > > diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c > > index 1acc44f..514cb99 100644 > > --- a/libavformat/avisynth.c > > +++ b/libavformat/avisynth.c > > @@ -29,7 +29,7 @@ > > > > /* Platform-specific directives for AviSynth vs AvxSynth. */ > > #ifdef _WIN32 > > - #include <windows.h> > > + #include "compat/w32dlfcn.h" > > #undef EXTERN_C > > #include "compat/avisynth/avisynth_c.h" > > #define AVISYNTH_LIB "avisynth" > > @@ -39,10 +39,6 @@ > > #include "compat/avisynth/avxsynth_c.h" > > #define AVISYNTH_NAME "libavxsynth" > > #define AVISYNTH_LIB AVISYNTH_NAME SLIBSUF > > - > > - #define LoadLibrary(x) dlopen(x, RTLD_NOW | RTLD_LOCAL) > > - #define GetProcAddress dlsym > > - #define FreeLibrary dlclose > > #endif > > > > typedef struct AviSynthLibrary { > > @@ -118,13 +114,13 @@ static av_cold void avisynth_atexit_handler(void); > > > > static av_cold int avisynth_load_library(void) > > { > > - avs_library.library = LoadLibrary(AVISYNTH_LIB); > > + avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_LOCAL); > > if (!avs_library.library) > > return AVERROR_UNKNOWN; > > > > #define LOAD_AVS_FUNC(name, continue_on_fail) \ > > avs_library.name = > \ > > - (void *)GetProcAddress(avs_library.library, #name); > \ > > + (void *)dlsym(avs_library.library, #name); \ > > if (!continue_on_fail && !avs_library.name) > \ > > goto fail; > > > > @@ -157,7 +153,7 @@ static av_cold int avisynth_load_library(void) > > return 0; > > > > fail: > > - FreeLibrary(avs_library.library); > > + dlclose(avs_library.library); > > return AVERROR_UNKNOWN; > > } > > > > @@ -225,7 +221,7 @@ static av_cold void avisynth_atexit_handler(void) > > avisynth_context_destroy(avs); > > avs = next; > > } > > - FreeLibrary(avs_library.library); > > + dlclose(avs_library.library); > > > > avs_atexit_called = 1; > > } > > -- 2.10.1.windows.1
On 10/30/2016 11:51 PM, Matt Oliver wrote: > On 31 October 2016 at 05:30, James Almer <jamrial@gmail.com> wrote: > >> On 10/30/2016 8:31 AM, Matt Oliver wrote: >>> From 1dc1f59158cfb12d9160ee47342f5742d67ad864 Mon Sep 17 00:00:00 2001 >>> From: Matt Oliver <protogonoi@gmail.com> >>> Date: Sun, 30 Oct 2016 15:13:47 +1100 >>> Subject: [PATCH] avformat/avisynth.c: Use new safe dlopen code. >>> >>> --- >>> configure | 5 ++--- >>> libavformat/avisynth.c | 14 +++++--------- >>> 2 files changed, 7 insertions(+), 12 deletions(-) >>> >>> diff --git a/configure b/configure >>> index 5993de5..9feb544 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -2850,6 +2850,7 @@ asf_stream_muxer_select="asf_muxer" >>> avi_demuxer_select="iso_media riffdec exif" >>> avi_muxer_select="riffenc" >>> avisynth_demuxer_deps="avisynth" >>> +avisynth_demuxer_deps_any="dlopen LoadLibrary" >>> avisynth_demuxer_select="riffdec" >> >> With this change and the stuff removed below, avisynth (CONFIG_AVISYNTH) >> will always be enabled if you configure with --enable-avisynth, and only >> avisynth_demuxer will be disabled depending on the presence of dlopen and >> LoadLibrary. >> This is probably not intended, seeing how libavformat/Makefile checks for >> CONFIG_AVISYNTH and not CONFIG_AVISYNTH_DEMUXER in order to compile the >> source file, so you should make it avisynth_deps_any="dlopen LoadLibrary" >> since avisynth_demuxer already depends on avisynth. >> >> Also, consider changing libavformat/Makefile to check for the demuxer >> rather than the library/feature. >> > > Changed, I also moved the avisynth stuff up to the external libraries > section of configure > > >> >>> caf_demuxer_select="iso_media riffdec" >>> dash_muxer_select="mp4_muxer" >>> @@ -5417,6 +5418,7 @@ elif check_func dlopen -ldl && check_func dlsym >> -ldl; then >>> ldl=-ldl >>> fi >>> >>> +avisynth_demuxer_extralibs='$ldl' >>> decklink_outdev_extralibs="$decklink_outdev_extralibs $ldl" >>> decklink_indev_extralibs="$decklink_indev_extralibs $ldl" >>> frei0r_filter_extralibs='$ldl' >>> @@ -5664,9 +5666,6 @@ fi >>> enabled avfoundation_indev && { check_header_objcc >> AVFoundation/AVFoundation.h || disable avfoundation_indev; } >>> enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h >> CGGetActiveDisplayList -framework CoreGraphics || >>> check_lib2 ApplicationServices/ApplicationServices.h >> CGGetActiveDisplayList -framework ApplicationServices; } >>> -enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } >> || >>> - { check_lib2 "dlfcn.h" dlopen -ldl; } || >>> - die "ERROR: LoadLibrary/dlopen not found >> for avisynth"; } >>> enabled cuda && { check_lib cuda.h cuInit -lcuda || >>> die "ERROR: CUDA not found"; } >>> enabled cuvid && { add_cflags -I$source_path; >>> diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c >>> index 1acc44f..514cb99 100644 >>> --- a/libavformat/avisynth.c >>> +++ b/libavformat/avisynth.c >>> @@ -29,7 +29,7 @@ >>> >>> /* Platform-specific directives for AviSynth vs AvxSynth. */ >>> #ifdef _WIN32 >>> - #include <windows.h> >>> + #include "compat/w32dlfcn.h" >>> #undef EXTERN_C >>> #include "compat/avisynth/avisynth_c.h" >>> #define AVISYNTH_LIB "avisynth" >>> @@ -39,10 +39,6 @@ >>> #include "compat/avisynth/avxsynth_c.h" >>> #define AVISYNTH_NAME "libavxsynth" >>> #define AVISYNTH_LIB AVISYNTH_NAME SLIBSUF >>> - >>> - #define LoadLibrary(x) dlopen(x, RTLD_NOW | RTLD_LOCAL) >>> - #define GetProcAddress dlsym >>> - #define FreeLibrary dlclose >>> #endif >>> >>> typedef struct AviSynthLibrary { >>> @@ -118,13 +114,13 @@ static av_cold void avisynth_atexit_handler(void); >>> >>> static av_cold int avisynth_load_library(void) >>> { >>> - avs_library.library = LoadLibrary(AVISYNTH_LIB); >>> + avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_LOCAL); >>> if (!avs_library.library) >>> return AVERROR_UNKNOWN; >>> >>> #define LOAD_AVS_FUNC(name, continue_on_fail) \ >>> avs_library.name = >> \ >>> - (void *)GetProcAddress(avs_library.library, #name); >> \ >>> + (void *)dlsym(avs_library.library, #name); \ >>> if (!continue_on_fail && !avs_library.name) >> \ >>> goto fail; >>> >>> @@ -157,7 +153,7 @@ static av_cold int avisynth_load_library(void) >>> return 0; >>> >>> fail: >>> - FreeLibrary(avs_library.library); >>> + dlclose(avs_library.library); >>> return AVERROR_UNKNOWN; >>> } >>> >>> @@ -225,7 +221,7 @@ static av_cold void avisynth_atexit_handler(void) >>> avisynth_context_destroy(avs); >>> avs = next; >>> } >>> - FreeLibrary(avs_library.library); >>> + dlclose(avs_library.library); >>> >>> avs_atexit_called = 1; >>> } >>> -- 2.10.1.windows.1 >>> >>> >>> _______________________________________________ >>> ffmpeg-devel mailing list >>> ffmpeg-devel@ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Tested under Ubuntu and Windows 10. The AviSynth stuff LGTM.
--- config.h 2016-10-29 17:17:55.214014842 +0200 +++ delth/config.h 2016-10-29 17:15:41.906012034 +0200 @@ -1155,7 +1155,7 @@ #define CONFIG_AST_DEMUXER 1 #define CONFIG_AU_DEMUXER 1 #define CONFIG_AVI_DEMUXER 1 -#define CONFIG_AVISYNTH_DEMUXER 1 +#define CONFIG_AVISYNTH_DEMUXER 0 #define CONFIG_AVR_DEMUXER 1 #define CONFIG_AVS_DEMUXER 1 #define CONFIG_BETHSOFTVID_DEMUXER 1