Add preliminary support for the swscale library if swscale is not included

in ffmpeg, there are some linux distro's running ancient versions still.

Originally committed to SVN as r1872.
This commit is contained in:
Amar Takhar 2008-03-03 08:57:08 +00:00
parent 65ed5fa6b8
commit ed4e70fae8
2 changed files with 15 additions and 4 deletions

View file

@ -37,7 +37,7 @@ if HAVE_FFMPEG
noinst_LIBRARIES += libaudiovideo_ffmpeg.a
libaudiovideo_ffmpeg_a_SOURCES = audio_provider_lavc.cpp lavc_file.cpp video_provider_lavc.cpp lavc_keyframes.cpp
libaudiovideo_ffmpeg_a_CFLAGS = @AVFORMAT_CFLAGS @AVCODEC_CFLAGS@
aegisub_LDFLAGS += @AVFORMAT_LDFLAGS@ @AVCODEC_LDFLAGS@
aegisub_LDFLAGS += @AVFORMAT_LDFLAGS@ @AVCODEC_LDFLAGS@ @SWSCALE_LDFLAGS@
endif
if HAVE_LIBASS

View file

@ -164,16 +164,27 @@ AC_ARG_WITH(ffmpeg, [ --without-ffmpeg build without FFMPEG video provid
if test "$without_ffmpeg" != xno; then
AC_CHECK_LIB([avcodec], [avcodec_init],AVCODEC_LDFLAGS="-lavcodec", [with_ffmpeg=no])
AC_CHECK_LIB([avformat], [av_read_frame],AVFORMAT_LDFLAGS="-lavcodec", [with_ffmpeg=no])
AC_CHECK_LIB([avformat], [sws_scale],[with_swscale="yes"], [with_swscale="no"])
AC_CHECK_LIB([avformat], [sws_scale],MOSTLY_HARMLESS=, [with_ffmpeg=no])
if test "$with_ffmpeg" != "no"; then
if test "$with_swscale" = "no"; then
AC_CHECK_LIB([swscale], [sws_scale],[SWSCALE_LDFLAGS="-lswscale"; with_swscale_lib="yes"], [with_swscale_lib="no"])
fi
if test "$with_swscale" = "yes" || test "$with_swscale_lib" = "yes"; then
with_ffmpeg="yes";
else
with_ffmpeg="no";
fi
if test "$with_ffmpeg" = "yes"; then
found_video_provider=yes
with_ffmpeg="yes"
AC_DEFINE(WITH_FFMPEG, 1, [Enable FFMPEG Video Provider])
fi
fi
AC_SUBST(SWSCALE_LDFLAGS)
AC_SUBST(AVCODEC_LDFLAGS)
AC_SUBST(AVFORMAT_LDFLAGS)
AM_CONDITIONAL([HAVE_FFMPEG], [test "$with_ffmpeg" != "no"])