Autodetect av_free_packet presence and compensate if not present

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k9copy@1172237 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 32cb73195f
commit 991863ab5e

@ -106,8 +106,21 @@ AC_CHECK_HEADER([ffmpeg/avcodec.h], \
[AC_DEFINE(NEW_FFMPEG,1, [new ffmpeg])], \ [AC_DEFINE(NEW_FFMPEG,1, [new ffmpeg])], \
[AC_MSG_ERROR([libavcodec may be missing]) ])]) [AC_MSG_ERROR([libavcodec may be missing]) ])])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
cxx_flags_safe="$CXXFLAGS"
cflags_safe="$CFLAGS"
CXXFLAGS="$CXXFLAGS -D__STDC_CONSTANT_MACROS"
CFLAGS="$CFLAGS -D__STDC_CONSTANT_MACROS"
AC_MSG_CHECKING([if libavformat/avformat.h provides av_free_packet])
AC_TRY_COMPILE([#include <libavformat/avformat.h>
],[AVPacket *packet; av_free_packet(packet);],
[AC_MSG_RESULT(yes)
AC_DEFINE(NEEDS_AV_FREE_PACKET,1,[no])],
AC_MSG_RESULT(no))
CXXFLAGS="$cxx_flags_safe"
CFLAGS="$cflags_safe"
AC_LANG_RESTORE
have_hal=no have_hal=no
AC_MSG_CHECKING(for the HAL) AC_MSG_CHECKING(for the HAL)

@ -49,6 +49,19 @@ AC_CHECK_HEADER([ffmpeg/avcodec.h], \
[AC_DEFINE(NEW_FFMPEG,1, [new ffmpeg])], \ [AC_DEFINE(NEW_FFMPEG,1, [new ffmpeg])], \
[AC_MSG_ERROR([libavcodec may be missing]) ])]) [AC_MSG_ERROR([libavcodec may be missing]) ])])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
cxx_flags_safe="$CXXFLAGS"
cflags_safe="$CFLAGS"
CXXFLAGS="$CXXFLAGS -D__STDC_CONSTANT_MACROS"
CFLAGS="$CFLAGS -D__STDC_CONSTANT_MACROS"
AC_MSG_CHECKING([if libavformat/avformat.h provides av_free_packet])
AC_TRY_COMPILE([#include <libavformat/avformat.h>
],[AVPacket *packet; av_free_packet(packet);],
[AC_MSG_RESULT(yes)
AC_DEFINE(NEEDS_AV_FREE_PACKET,1,[no])],
AC_MSG_RESULT(no))
CXXFLAGS="$cxx_flags_safe"
CFLAGS="$cflags_safe"
AC_LANG_RESTORE

@ -16,6 +16,7 @@
#endif #endif
#ifdef NEW_FFMPEG #ifdef NEW_FFMPEG
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#endif #endif
#include <qimage.h> #include <qimage.h>
@ -28,6 +29,8 @@ void *CodecHandle=0;
void *FormatHandle=0; void *FormatHandle=0;
int glibref=0; int glibref=0;
#ifdef NEW_FFMPEG
#ifdef NEEDS_AV_FREE_PACKET
void av_free_packet(AVPacket *pkt) void av_free_packet(AVPacket *pkt)
{ {
if (pkt) { if (pkt) {
@ -35,6 +38,8 @@ void av_free_packet(AVPacket *pkt)
pkt->data = NULL; pkt->size = 0; pkt->data = NULL; pkt->size = 0;
} }
} }
#endif
#endif
k9AviDecode::k9AviDecode(QObject *parent, const char *name) k9AviDecode::k9AviDecode(QObject *parent, const char *name)
: QObject(parent, name) { : QObject(parent, name) {

Loading…
Cancel
Save