Closed sagitter closed 3 years ago
machinestate.c:590:59: warning: attempt to free a non-heap object 'pt1' [-Wfree-nonheap-object]
Fixed.
/usr/bin/ld: /tmp/lives-exe.W2CUBD.ltrans49.ltrans.o: in function resize_layer': /builddir/build/BUILD/LiVES-3.2.0-pre8/src/colourspace.c:12767: undefined reference to
weed_palette_to_avi_pix_fmt'
/usr/bin/ld: /builddir/build/BUILD/LiVES-3.2.0-pre8/src/colourspace.c:12768: undefined reference to weed_palette_to_avi_pix_fmt' /usr/bin/ld: /tmp/lives-exe.W2CUBD.ltrans63.ltrans.o: in function
on_open_vdev_activate':
/builddir/build/BUILD/LiVES-3.2.0-pre8/src/videodev.c:191: undefined reference to fourccp_to_weedp' /usr/bin/ld: /builddir/build/BUILD/LiVES-3.2.0-pre8/src/videodev.c:337: undefined reference to
fourccp_to_weedp'
collect2: error: ld returned 1 exit status
Both functions are defined (as inline) in libweed/weed-compat.h, which is included from main.h There is no reason why these functions should not be found, and I am unable to reproduce the issue, even using configure --disable-system-weed.
Does it help if you change "inline" to "static inline" in weed-compat.h ?
Otherwise it may require attribute __ always_inline __
Failing this, I would need to create libweed-compat, which is something I am trying to avoid
It may also be a case that weed-compat.h needs to be called directly from the .c files, rather than indirectly via main.h I am not sure - perhaps you can try this also.
It may also be a case that weed-compat.h needs to be called directly from the .c files, rather than indirectly via main.h I am not sure - perhaps you can try this also.
Tested with this patch but does not work..
--- a/src/videodev.orig.c 2020-11-03 06:37:10.000000000 +0100
+++ b/src/videodev.c 2020-11-04 11:38:37.686032592 +0100
@@ -14,6 +14,7 @@
#include "effects-weed.h"
#include <unicap/unicap.h>
+#include "../libweed/weed-compat.h"
static boolean lives_wait_user_buffer(lives_vdev_t *ldev, unicap_data_buffer_t **buff, double timeout) {
// wait for USER type buffer
Disabling the LTO flags (-flto=auto -ffat-lto-objects
), just undefined reference to fourccp_to_weedp'
remains as linker failure.
You would need to include it before "main.h" I think. However this may not be necessary:
Another user who experienced similar problems has reported that changing all of the "inline" in weed-compat.h to "static inline" may resolve the problem. Could you try this and let me know if it fixes the problem for you.
You would need to include it before "main.h" I think. However this may not be necessary:
Another user who experienced similar problems has reported that changing all of the "inline" in weed-compat.h to "static inline" may resolve the problem. Could you try this and let me know if it fixes the problem for you.
Doesn't work for me, unfortunately, with:
--- a/src/videodev.orig.c 2020-11-03 06:37:10.000000000 +0100
+++ b/src/videodev.c 2020-11-04 11:38:37.686032592 +0100
@@ -3,6 +3,7 @@
// released under the GNU GPL 3 or later
// see file COPYING or www.gnu.org for details
+#include "../libweed/weed-compat.h"
#include "main.h"
#ifdef HAVE_UNICAP
--- a/libweed/weed-compat.orig.h 2020-11-03 06:37:10.000000000 +0100
+++ b/libweed/weed-compat.h 2020-11-05 16:17:49.084800148 +0100
@@ -85,7 +85,7 @@
#endif
-inline int fourccp_to_weedp(unsigned int fourcc, int bpp, int *interlaced, int *sampling,
+static inline int fourccp_to_weedp(unsigned int fourcc, int bpp, int *interlaced, int *sampling,
int *sspace, int *clamping) {
// inputs are fourcc and bpp
// returns int weed_palette
@@ -679,7 +679,7 @@
#if defined FF_API_PIX_FMT || defined AVUTIL_PIXFMT_H
-inline int avi_color_range_to_weed_clamping(enum AVColorRange range) {
+static inline int avi_color_range_to_weed_clamping(enum AVColorRange range) {
switch (range) {
case AVCOL_RANGE_MPEG:
return WEED_YUV_CLAMPING_CLAMPED;
@@ -691,7 +691,7 @@
return WEED_YUV_CLAMPING_CLAMPED;
}
-inline enum AVColorRange weed_clamping_to_avi_color_range(int clamping) {
+static inline enum AVColorRange weed_clamping_to_avi_color_range(int clamping) {
switch (clamping) {
case WEED_YUV_CLAMPING_CLAMPED:
return AVCOL_RANGE_MPEG;
@@ -703,7 +703,7 @@
#ifndef AVUTIL_PIXFMT_H
-inline int avi_pix_fmt_to_weed_palette(enum PixelFormat pix_fmt, int *clamped) {
+static inline int avi_pix_fmt_to_weed_palette(enum PixelFormat pix_fmt, int *clamped) {
// clamped may be set to NULL if you are not interested in the value
switch (pix_fmt) {
case PIX_FMT_RGB24:
@@ -753,7 +753,7 @@
}
}
-inline enum PixelFormat weed_palette_to_avi_pix_fmt(int pal, int *clamped) {
+static inline enum PixelFormat weed_palette_to_avi_pix_fmt(int pal, int *clamped) {
switch (pal) {
case WEED_PALETTE_RGB24:
return PIX_FMT_RGB24;
@@ -800,7 +800,7 @@
#else
-inline int avi_pix_fmt_to_weed_palette(enum AVPixelFormat pix_fmt, int *clamped) {
+static inline int avi_pix_fmt_to_weed_palette(enum AVPixelFormat pix_fmt, int *clamped) {
// clamped may be set to NULL if you are not interested in the value
switch (pix_fmt) {
case AV_PIX_FMT_RGB24:
@@ -847,7 +847,7 @@
}
}
-inline enum AVPixelFormat weed_palette_to_avi_pix_fmt(int pal, int *clamped) {
+static inline enum AVPixelFormat weed_palette_to_avi_pix_fmt(int pal, int *clamped) {
switch (pal) {
case WEED_PALETTE_RGB24:
return AV_PIX_FMT_RGB24;
@@ -892,7 +892,7 @@
#endif // avutil
#endif // pix fmts
-inline int avi_trc_to_weed_gamma(enum AVColorTransferCharacteristic trc) {
+static inline int avi_trc_to_weed_gamma(enum AVColorTransferCharacteristic trc) {
switch (trc) {
case AVCOL_TRC_BT709:
return WEED_GAMMA_BT709;
@@ -906,7 +906,7 @@
return WEED_GAMMA_UNKNOWN;
}
-inline enum AVColorTransferCharacteristic weed_gamma_to_avi_trc(int gamma_type) {
+static inline enum AVColorTransferCharacteristic weed_gamma_to_avi_trc(int gamma_type) {
switch (gamma_type) {
case WEED_GAMMA_BT709:
return AVCOL_TRC_BT709;
@@ -1029,21 +1029,21 @@
#define HAVE_PANGO_FONT_STYLE 1
#define HAVE_PANGO_FONT_SIZE 1
-inline int font_stretch_to_pango_stretch(const char *stretch) {
+static inline int font_stretch_to_pango_stretch(const char *stretch) {
PangoFontDescription *pfd = pango_font_description_from_string(stretch);
PangoStretch pstretch = pango_font_description_get_stretch(pfd);
pango_font_description_free(pfd);
return pstretch;
}
-inline int font_weight_to_pango_weight(const char *weight) {
+static inline int font_weight_to_pango_weight(const char *weight) {
PangoFontDescription *pfd = pango_font_description_from_string(weight);
PangoWeight pweight = pango_font_description_get_weight(pfd);
pango_font_description_free(pfd);
return pweight;
}
-inline int font_style_to_pango_style(const char *style) {
+static inline int font_style_to_pango_style(const char *style) {
PangoFontDescription *pfd = pango_font_description_from_string(style);
PangoStyle pstyle = pango_font_description_get_style(pfd);
pango_font_description_free(pfd);
Try with removing the extra #include, but leaving the "static inline" changes.
Try with removing the extra #include, but leaving the "static inline" changes.
It works!
Great ! Fix checked in.
Hi again.
After the fix posted in #21, i still obtain:
Lives-3.2.0-pre8 Full build log: http://koji.rpmfusion.org/kojifiles/work/tasks/5970/445970/build.log