Fixing compiltion issues of ffmpeg

This commit is contained in:
Zoe Roux
2021-03-19 14:48:27 +01:00
parent d972f4e811
commit 00abdd86f6
3 changed files with 14 additions and 11 deletions

View File

@@ -16,12 +16,13 @@ add_library(transcoder SHARED
src/destroyer.c)
set_property(TARGET transcoder PROPERTY C_STANDARD 11)
target_link_libraries(transcoder
${CMAKE_SOURCE_DIR}/ffmpeg/libavformat/libavformat.a
${CMAKE_SOURCE_DIR}/ffmpeg/libavcodec/libavcodec.a
${CMAKE_SOURCE_DIR}/ffmpeg/libavutil/libavutil.a
target_link_libraries(transcoder avformat avcodec avutil)
target_link_directories(transcoder PRIVATE
${CMAKE_SOURCE_DIR}/ffmpeg/libavformat
${CMAKE_SOURCE_DIR}/ffmpeg/libavcodec
${CMAKE_SOURCE_DIR}/ffmpeg/libavutil
)
target_link_libraries(transcoder m)
target_link_libraries(transcoder m pthread)
if(WIN32)
target_link_libraries(transcoder wsock32 ws2_32)
@@ -33,11 +34,13 @@ include(ExternalProject)
ExternalProject_Add(FFMPEG
SOURCE_DIR ${CMAKE_SOURCE_DIR}/ffmpeg
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./configure --pkg-config-flags=--static --disable-shared --enable-static
--disable-zlib --disable-iconv --disable-asm
--disable-programs --disable-doc
--disable-avdevice --disable-swresample --disable-swscale --disable-postproc --disable-network
CONFIGURE_COMMAND ./configure --disable-shared --enable-static --enable-pic
--disable-debug --enable-gpl --enable-version3 --disable-asm
--disable-programs --disable-doc --disable-autodetect
--disable-avdevice --disable-swresample --disable-swscale --disable-postproc --disable-network
BUILD_COMMAND make
INSTALL_COMMAND cmake -E echo "Skipping install step."
)
add_dependencies(transcoder FFMPEG)
set_property(TARGET transcoder PROPERTY POSITION_INDEPENDENT_CODE ON)

View File

@@ -67,7 +67,7 @@ type type_fromffmpeg(AVStream *stream)
case AVMEDIA_TYPE_SUBTITLE:
return subtitle;
case AVMEDIA_TYPE_ATTACHMENT:
if (!strcmp(avcodec_get_name(stream->codecpar->codec_id), "ttf"))
if (!strcasecmp(avcodec_get_name(stream->codecpar->codec_id), "ttf"))
return font;
return none;
default:

View File

@@ -10,7 +10,7 @@ INCLUDE = -I ../include
CFLAGS = $(INCLUDE) -Wall -Wextra -Wshadow -g
LDFLAGS = -L ../cmake-build-debug -ltranscoder
LDFLAGS = -L ../cmake-build-debug -ltranscoder -lpthread
NAME = ts