From d43538bcc3b60c61356e36660c49e124fe073ada Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Mon, 26 Jun 2006 23:29:54 +0000 Subject: [PATCH] People keep trying to use newer versions of ffmpeg and it is failing either to compile (in which case they just patch our code to get it to compile) or it crashes when trying to play movies. Check for two things. First, check that the version and build numbers reported in the headers match those returned by the library which should prevent any header/lib mismatch crashes. Second, check for exactly the version/build numbers that we know work are are used in both windows and OS X and worked correctly for ppc linux. If a large number of reports come in with header/lib mismatches, I'll consider removing the check for exactly the version/build numbers. --- stepmania/autoconf/m4/video.m4 | 42 ++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/stepmania/autoconf/m4/video.m4 b/stepmania/autoconf/m4/video.m4 index 438e947ec3..e07ac07bba 100644 --- a/stepmania/autoconf/m4/video.m4 +++ b/stepmania/autoconf/m4/video.m4 @@ -21,26 +21,40 @@ AC_SEARCH_LIBS(guess_format, [avformat], have_libavformat=yes, have_libavformat fi if test "$have_libavcodec" = "yes"; then - AC_MSG_CHECKING([for libavcodec >= 0.4.9]) + AC_MSG_CHECKING([for matching libavcodec headers and libs]) AC_TRY_RUN([ - #include - int main() - { - return ( LIBAVCODEC_VERSION_INT < 0x000409 )? 1:0; - } - ],,have_libavcodec=no,) + #include + int main() + { + return ( LIBAVCODEC_VERSION_INT == avcodec_version() && + LIBAVCODEC_BUILD == avcodec_build() ) ? 0:1; + } + ],,have_libavcodec=no,) AC_MSG_RESULT($have_libavcodec) + if test "$have_libavcodec" = "yes"; then + AC_MSG_CHECKING([for libavcodec = 0.4.9-pre1]) + AC_TRY_RUN([ + #include + int main() + { + return ( LIBAVCODEC_VERSION_INT == 0x000409 && + LIBAVCODEC_BUILD == 4718 ) ? 0:1; + } + ],,have_libavcodec=no,) + AC_MSG_RESULT($have_libavcodec) + fi fi if test "$have_libavformat" = "yes"; then - AC_MSG_CHECKING([for libavformat >= 0.4.9]) + AC_MSG_CHECKING([for libavformat = 0.4.9-pre1]) AC_TRY_RUN([ - #include - int main() - { - return ( LIBAVFORMAT_VERSION_INT < 0x000409 )? 1:0; - } - ],,have_libavformat=no,) + #include + int main() + { + return ( LIBAVFORMAT_VERSION_INT == 0x000409 && + LIBAVFORMAT_BUILD == 4616 )? 0:1; + } + ],,have_libavformat=no,) AC_MSG_RESULT($have_libavformat) fi fi