Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
d6f85ec2
Commit
d6f85ec2
authored
Oct 31, 2016
by
Matt Oliver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/avisynth.c: Use new safe dlopen code.
Signed-off-by:
Matt Oliver
<
protogonoi@gmail.com
>
parent
85db1f97
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
15 deletions
+10
-15
configure
configure
+4
-5
Makefile
libavformat/Makefile
+1
-1
avisynth.c
libavformat/avisynth.c
+5
-9
No files found.
configure
View file @
d6f85ec2
...
...
@@ -2753,6 +2753,9 @@ ac3_at_decoder_select="ac3_parser"
adpcm_ima_qt_at_decoder_deps
=
"audiotoolbox"
alac_at_decoder_deps
=
"audiotoolbox"
amr_nb_at_decoder_deps
=
"audiotoolbox"
avisynth_deps_any
=
"dlopen LoadLibrary"
avisynth_demuxer_deps
=
"avisynth"
avisynth_demuxer_select
=
"riffdec"
eac3_at_decoder_deps
=
"audiotoolbox"
eac3_at_decoder_select
=
"ac3_parser"
gsm_ms_at_decoder_deps
=
"audiotoolbox"
...
...
@@ -2846,8 +2849,6 @@ asf_muxer_select="riffenc"
asf_stream_muxer_select
=
"asf_muxer"
avi_demuxer_select
=
"iso_media riffdec exif"
avi_muxer_select
=
"riffenc"
avisynth_demuxer_deps
=
"avisynth"
avisynth_demuxer_select
=
"riffdec"
caf_demuxer_select
=
"iso_media riffdec"
dash_muxer_select
=
"mp4_muxer"
dirac_demuxer_select
=
"dirac_parser"
...
...
@@ -5414,6 +5415,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'
...
...
@@ -5661,9 +5663,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
;
...
...
libavformat/Makefile
View file @
d6f85ec2
...
...
@@ -106,7 +106,7 @@ OBJS-$(CONFIG_AU_DEMUXER) += au.o pcm.o
OBJS-$(CONFIG_AU_MUXER)
+=
au.o
rawenc.o
OBJS-$(CONFIG_AVI_DEMUXER)
+=
avidec.o
OBJS-$(CONFIG_AVI_MUXER)
+=
avienc.o
mpegtsenc.o
avlanguage.o
rawutils.o
OBJS-$(CONFIG_AVISYNTH
)
+=
avisynth.o
OBJS-$(CONFIG_AVISYNTH
_DEMUXER)
+=
avisynth.o
OBJS-$(CONFIG_AVM2_MUXER)
+=
swfenc.o
swf.o
OBJS-$(CONFIG_AVR_DEMUXER)
+=
avr.o
pcm.o
OBJS-$(CONFIG_AVS_DEMUXER)
+=
avs.o
voc_packet.o
vocdec.o
voc.o
...
...
libavformat/avisynth.c
View file @
d6f85ec2
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment