The function signature changed:
* MP4Read(path, flag) -> MP4Read(path)
* MP4Close(handle) -> MP4Close(handle, flags)
Then detect this and add a new define to choose how to use functions.
if test "x$HAVE_MP4_HEADERS" = "xyes"; then
AC_DEFINE(HAVE_MP4, 1, Define if mp4.h is present)
fi
+
+ # test for new 2.0 api
+ if test "x$HAVE_MP4V2_HEADERS" = "xyes"; then
+ AC_MSG_CHECKING([mp4v2 2.0 API (MP4Read and MP4Close)])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [[#include <mp4v2/mp4v2.h>]],
+ [[MP4FileHandle fh = MP4Read("/tmp");
+ MP4Close(fh, 0);
+ ]])],
+ [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_MP4V2_2_0_API, 1, Define to 1 if you have mp4v2 2.0 api)
+ ], [AC_MSG_RESULT([no])])
+ fi
else
MP4=false
fi
MP4FileHandle mp4_fh;
u_int32_t num_tracks;
+#ifdef HAVE_MP4V2_2_0_API
+ mp4_fh = MP4Read(finfo->path);
+#else
mp4_fh = MP4Read(finfo->path, 0);
+#endif
if (mp4_fh == MP4_INVALID_FILE_HANDLE) {
fprintf(stderr, "ERROR: cannot read mp4 file %s\n", finfo->path);
return -1;
r = lms_db_video_add(plugin->video_db, &video_info);
}
+#ifdef HAVE_MP4V2_2_0_API
+ MP4Close(mp4_fh, 0);
+#else
MP4Close(mp4_fh);
+#endif
if (info.title.str)
free(info.title.str);