From ed4e70fae8b1afb7d3c63163996d9ffe0ebf8569 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Mon, 3 Mar 2008 08:57:08 +0000 Subject: [PATCH] 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. --- aegisub/Makefile.am | 2 +- configure.in | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/aegisub/Makefile.am b/aegisub/Makefile.am index 18330264e..7008d3a61 100644 --- a/aegisub/Makefile.am +++ b/aegisub/Makefile.am @@ -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 diff --git a/configure.in b/configure.in index aca1d0fb5..a62c4e207 100644 --- a/configure.in +++ b/configure.in @@ -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"])