Skip to content

Commit a8262fc

Browse files
committed
Enable and fix avformat module with MSVC
1 parent 9242197 commit a8262fc

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"cacheVariables": {
1111
"BUILD_TESTING": "OFF",
1212
"SWIG_PYTHON": "OFF",
13-
"MOD_AVFORMAT": "OFF",
13+
"MOD_AVFORMAT": "ON",
1414
"MOD_DECKLINK": "OFF",
1515
"MOD_FREI0R": "OFF",
1616
"MOD_GDK": "OFF",

src/modules/avformat/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ target_link_libraries(mltavformat PRIVATE
3939
)
4040

4141
if(MSVC)
42-
target_link_libraries(mltavformat PRIVATE PThreads4W::PThreads4W)
42+
target_link_libraries(mltavformat PRIVATE PThreads4W::PThreads4W msvccompat)
4343
else()
4444
target_link_libraries(mltavformat PRIVATE m)
4545
endif()

src/modules/avformat/consumer_avformat.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@
3131
#include <stdio.h>
3232
#include <stdlib.h>
3333
#include <string.h>
34-
#include <sys/time.h>
3534
#include <time.h>
35+
36+
#ifdef _MSC_VER
37+
#include <gettimeofday.h>
38+
#else
39+
#include <sys/time.h>
3640
#include <unistd.h>
41+
#endif
3742

3843
// avformat header files
3944
#include <libavcodec/avcodec.h>

vcpkg.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"libiconv",
88
"pkgconf",
99
"pthreads",
10-
"sdl2"
10+
"sdl2",
11+
"ffmpeg"
1112
]
1213
}

0 commit comments

Comments
 (0)