diff mbox series

[FFmpeg-devel,v6,3/3] avfilter: Make avpriv_open a library-internal function on msvcrt

Message ID 4035d5dd7b2309e7329fc7ae5123945a5bef1e65.1653002114.git.ffmpegagent@gmail.com
State New
Headers show
Series use av_fopen_utf8() instead of plain fopen() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Aman Karmani May 19, 2022, 11:15 p.m. UTC
From: softworkz <softworkz@hotmail.com>

This applies the same change for libavfilter as commit
e743e7ae6ee7e535c4394bec6fe6650d2b0dbf65 did for the other libraries.

Original commit message:

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.

Based-on-patch-by: Martin Storsjö <martin@martin.st>
Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/Makefile    | 1 +
 libavfilter/file_open.c | 1 +
 tests/ref/fate/source   | 1 +
 3 files changed, 3 insertions(+)
 create mode 100644 libavfilter/file_open.c
diff mbox series

Patch

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index ee2ea51e69..78ccfa37d3 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -23,6 +23,7 @@  OBJS = allfilters.o                                                     \
        version.o                                                        \
        video.o                                                          \
 
+OBJS-$(HAVE_LIBC_MSVCRT)                     += file_open.o
 OBJS-$(HAVE_THREADS)                         += pthread.o
 
 # subsystems
diff --git a/libavfilter/file_open.c b/libavfilter/file_open.c
new file mode 100644
index 0000000000..494a5d37a4
--- /dev/null
+++ b/libavfilter/file_open.c
@@ -0,0 +1 @@ 
+#include "libavutil/file_open.c"
diff --git a/tests/ref/fate/source b/tests/ref/fate/source
index 69dcdc4f27..16ea7ef9c1 100644
--- a/tests/ref/fate/source
+++ b/tests/ref/fate/source
@@ -8,6 +8,7 @@  libavcodec/reverse.c
 libavdevice/file_open.c
 libavdevice/reverse.c
 libavfilter/af_arnndn.c
+libavfilter/file_open.c
 libavfilter/log2_tab.c
 libavformat/file_open.c
 libavformat/golomb_tab.c