diff mbox series

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

Message ID 5e50103af3138f088fb18ea1edd85db9f30f52e1.1652996437.git.ffmpegagent@gmail.com
State New
Headers show
Series use av_fopen_utf8() instead of plain fopen() | expand


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

Commit Message

softworkz May 19, 2022, 9:40 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 +
 2 files changed, 2 insertions(+)
 create mode 100644 libavfilter/file_open.c
diff mbox series


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"