From 8770829e09b31274ce83c21a0061492692bc6820 Mon Sep 17 00:00:00 2001 From: August Gustavsson Date: Wed, 30 Mar 2011 11:33:17 +0200 Subject: [PATCH] Added one more case to detect lua 5.1. Fixed avformat API breakage for versions > 52.67.0 --- autoconf/m4/lua.m4 | 6 ++++++ src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/autoconf/m4/lua.m4 b/autoconf/m4/lua.m4 index e66c2e80..ea4a44ab 100755 --- a/autoconf/m4/lua.m4 +++ b/autoconf/m4/lua.m4 @@ -26,6 +26,12 @@ else AC_CHECK_LIB(lua, lua_open, LIB_LUA=-llua) fi if test "$LIB_LUA" = ""; then + AC_CHECK_LIB(lua, luaL_newstate, LIB_LUA=-llua) + if test "$LIB_LUA" != ""; then + AC_DEFINE([HAVE_LUA51], [1], [The system has Lua 5.1 instead of Lua 5.0]) + fi + fi + if test "$LIB_LUA" = ""; then AC_CHECK_LIB(lua50, lua_open, LIB_LUA=-llua50) fi if test "$LIB_LUA" = ""; then diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index 0f850fd5..e18484e5 100755 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -581,7 +581,11 @@ int URLRageFile_read( avcodec::URLContext *h, unsigned char *buf, int size ) return f->Read( buf, size ); } +#if LIBAVFORMAT_BUILD > AV_VERSION_INT(52, 67, 0) +int URLRageFile_write( avcodec::URLContext *h, const unsigned char *buf, int size ) +#else int URLRageFile_write( avcodec::URLContext *h, unsigned char *buf, int size ) +#endif { RageFile *f = (RageFile *) h->priv_data; return f->Write( buf, size ); -- 2.11.0