mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-04-03 09:03:50 +00:00
Reed-Solomon (zfec): fixed fec_new fail
With current zfec code, fec_init() needs to be called prior to fec_new(), otherwise the later one returns NULL. \+ updated submodule to the current zfec version (requiring fec_init(); but UG will compile with the older zfec version as well)
This commit is contained in:
13
configure.ac
13
configure.ac
@@ -2554,6 +2554,19 @@ if test $cross_compile = no && test "$zfec_req" != no; then
|
||||
fi
|
||||
AC_CHECK_FILES([$ZFEC_PREFIX/fec.c $ZFEC_PREFIX/fec.h], [found_zfec=yes])
|
||||
fi
|
||||
if test "$found_zfec" = yes; then
|
||||
AC_MSG_CHECKING([fec_init declaration in $ZFEC_PREFIX/fec.h])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include "$ZFEC_PREFIX/fec.h"
|
||||
]],
|
||||
[[
|
||||
#pragma GCC diagnostic error "-Wimplicit-function-declaration"
|
||||
fec_init();]])], fec_init=yes, fec_init=no)
|
||||
if test "$fec_init" = yes; then
|
||||
AC_DEFINE([HAVE_FEC_INIT], [1], [fec_init must be called before fec_new])
|
||||
fi
|
||||
AC_MSG_RESULT($fec_init)
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$found_zfec" = yes; then
|
||||
|
||||
Submodule ext-deps/zfec updated: 4eb5c7c99a...049599ac0e
11
src/host.cpp
11
src/host.cpp
@@ -99,6 +99,13 @@
|
||||
#define X11_LIB_NAME "libX11.so.6"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FEC_INIT
|
||||
#define restrict __restrict // not a C++ keyword
|
||||
extern "C" {
|
||||
#include <fec.h>
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#include <mcheck.h>
|
||||
#endif
|
||||
@@ -431,6 +438,10 @@ struct init_data *common_preinit(int argc, char *argv[])
|
||||
incompatible_features = true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_FEC_INIT
|
||||
fec_init();
|
||||
#endif
|
||||
|
||||
return new init_data{init};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user