mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 12:01:51 +00:00
fixes for using FFMPEG on windows
This commit is contained in:
parent
e32646ee50
commit
7ea1f6a02a
@ -153,6 +153,10 @@ void FFmpeg_Decoder::open(const std::string &fname)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
for(size_t j = 0;j < mFormatCtx->nb_streams;j++)
|
||||||
|
if(mFormatCtx->streams[j]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||||
|
mFormatCtx->streams[j]->codec->request_sample_fmt = AV_SAMPLE_FMT_S16;
|
||||||
|
|
||||||
if(avformat_find_stream_info(mFormatCtx, NULL) < 0)
|
if(avformat_find_stream_info(mFormatCtx, NULL) < 0)
|
||||||
fail("Failed to find stream info in "+fname);
|
fail("Failed to find stream info in "+fname);
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@ macro(find_component _component _pkgconfig _library _header)
|
|||||||
|
|
||||||
find_path(${_component}_INCLUDE_DIRS ${_header}
|
find_path(${_component}_INCLUDE_DIRS ${_header}
|
||||||
HINTS
|
HINTS
|
||||||
|
${FFMPEGSDK_INC}
|
||||||
${PC_LIB${_component}_INCLUDEDIR}
|
${PC_LIB${_component}_INCLUDEDIR}
|
||||||
${PC_LIB${_component}_INCLUDE_DIRS}
|
${PC_LIB${_component}_INCLUDE_DIRS}
|
||||||
PATH_SUFFIXES
|
PATH_SUFFIXES
|
||||||
@ -76,6 +77,7 @@ macro(find_component _component _pkgconfig _library _header)
|
|||||||
|
|
||||||
find_library(${_component}_LIBRARIES NAMES ${_library}
|
find_library(${_component}_LIBRARIES NAMES ${_library}
|
||||||
HINTS
|
HINTS
|
||||||
|
${FFMPEGSDK_LIB}
|
||||||
${PC_LIB${_component}_LIBDIR}
|
${PC_LIB${_component}_LIBDIR}
|
||||||
${PC_LIB${_component}_LIBRARY_DIRS}
|
${PC_LIB${_component}_LIBRARY_DIRS}
|
||||||
)
|
)
|
||||||
@ -97,6 +99,12 @@ endmacro()
|
|||||||
# Check for cached results. If there are skip the costly part.
|
# Check for cached results. If there are skip the costly part.
|
||||||
if (NOT FFMPEG_LIBRARIES)
|
if (NOT FFMPEG_LIBRARIES)
|
||||||
|
|
||||||
|
set (FFMPEGSDK ENV${FFMPEG_HOME})
|
||||||
|
if (FFMPEGSDK)
|
||||||
|
set (FFMPEGSDK_INC "${FFMPEGSDK}/include")
|
||||||
|
set (FFMPEGSDK_LIB "${FFMPEGSDK}/lib")
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Check for all possible component.
|
# Check for all possible component.
|
||||||
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
|
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
|
||||||
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
|
find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
|
||||||
|
Loading…
Reference in New Issue
Block a user