mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-26 20:50:34 +00:00
libavutil: Make avpriv_open a library-internal function on msvcrt
Add one copy of the function into each of the libraries, similarly to what we do for log2_tab. When using static libs, only one copy of the file_open.o object file gets included, while when using shared libraries, each of them get a copy of its own. This fixes DLL builds with a statically linked C runtime, where each DLL effectively has got its own instance of the C runtime, where file descriptors can't be shared across runtimes. On systems not using msvcrt, the function is not duplicated. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
a76d0cdf21
commit
e743e7ae6e
@ -26,6 +26,8 @@ OBJS = allcodecs.o \
|
||||
raw.o \
|
||||
utils.o \
|
||||
|
||||
OBJS-$(HAVE_MSVCRT) += file_open.o
|
||||
|
||||
# parts needed for many different codecs
|
||||
OBJS-$(CONFIG_AANDCTTABLES) += aandcttab.o
|
||||
OBJS-$(CONFIG_AC3DSP) += ac3dsp.o
|
||||
|
1
libavcodec/file_open.c
Normal file
1
libavcodec/file_open.c
Normal file
@ -0,0 +1 @@
|
||||
#include "libavutil/file_open.c"
|
@ -7,6 +7,8 @@ HEADERS = avdevice.h \
|
||||
OBJS = alldevices.o \
|
||||
avdevice.o \
|
||||
|
||||
OBJS-$(HAVE_MSVCRT) += file_open.o
|
||||
|
||||
# input/output devices
|
||||
OBJS-$(CONFIG_ALSA_INDEV) += alsa-audio-common.o \
|
||||
alsa-audio-dec.o
|
||||
|
1
libavdevice/file_open.c
Normal file
1
libavdevice/file_open.c
Normal file
@ -0,0 +1 @@
|
||||
#include "libavutil/file_open.c"
|
@ -23,6 +23,8 @@ OBJS = allformats.o \
|
||||
url.o \
|
||||
utils.o \
|
||||
|
||||
OBJS-$(HAVE_MSVCRT) += file_open.o
|
||||
|
||||
OBJS-$(CONFIG_NETWORK) += network.o
|
||||
OBJS-$(CONFIG_RIFFDEC) += riffdec.o
|
||||
OBJS-$(CONFIG_RIFFENC) += riffenc.o
|
||||
|
1
libavformat/file_open.c
Normal file
1
libavformat/file_open.c
Normal file
@ -0,0 +1 @@
|
||||
#include "libavutil/file_open.c"
|
@ -196,6 +196,10 @@ void avpriv_report_missing_feature(void *avc,
|
||||
void avpriv_request_sample(void *avc,
|
||||
const char *msg, ...) av_printf_format(2, 3);
|
||||
|
||||
#if HAVE_MSVCRT
|
||||
#define avpriv_open ff_open
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A wrapper for open() setting O_CLOEXEC.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user