hzeller / gmrender-resurrect

Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer. Fork of GMediaRenderer to add some features to make it usable.
GNU General Public License v2.0
834 stars 202 forks source link

Compatibility with Glib 2.18 #46

Closed sejerpz closed 10 years ago

sejerpz commented 10 years ago

I use gmrender with my old chumby that has glib 2.18.

Every time I need to recompile I've to apply a simple patch in order to support old way of initializing thread in glib

Here the snippet if you really want I can do a merge request:

http://pastebin.com/3J1FYK2E

Thanks for the software.

hzeller commented 10 years ago

On 29 October 2013 12:59, sejerpz notifications@github.com wrote:

I use gmrender with my old chumby that has glib 2.18.

Every time I need to recompile I've to apply a simple patch in order to support old way of initializing thread in glib

What is happening with the old glib ? Does it not have the symbols, or does the code break ?

In general, sounds good, I'll have see that I can get that applied later tonight. It looks like you're comparing against a particular version of glib, this should probably be a less-than/larger-than thing ? Can you figure out the exact cut-off version for me ?

Thanks, Henner.

Here the snippet if you really want I can do a merge request:

http://pastebin.com/3J1FYK2E

Thanks for the software.

— Reply to this email directly or view it on GitHubhttps://github.com/hzeller/gmrender-resurrect/issues/46 .

sejerpz commented 10 years ago

It doesn't have the 'g_thread_get_initialized' function (introduced in glib 2.20) but only the g_thread_supported () [1]

According to the docs g_thread_init wasn't necessary anymore from 2.32 [2]

Regarding the check the name of the macro is a bit measleading but the docs says:

TRUE if the version of the GLib header files is the same as or newer than the passed-in version.

Last but not least, I had to move function call at the beginning of the main function to prevent some gstreamer 0.10 warning (or error? I don't remember exactly) even when just parsing the options without threads initialized.

[1] https://developer.gnome.org/glib/2.38/glib-Deprecated-Thread-APIs.html#g-thread-supported [2] https://developer.gnome.org/glib/2.38/glib-Deprecated-Thread-APIs.html#g-thread-init [3] https://developer.gnome.org/glib/2.38/glib-Version-Information.html#GLIB-CHECK-VERSION:CAPS

Here my compilation log:

andrea@rosso:~/Devel/3rdy/chumby/gmrender-resurrect$ sb2 make make all-recursive make[1]: Entering directory /home/andrea/Devel/3rdy/chumby/gmrender-resurrect' Making all in src make[2]: Entering directory/home/andrea/Devel/3rdy/chumby/gmrender-resurrect/src' (echo "#define GM_COMPILE_VERSION \"2013-10-27_1dfa850\"" > git-version.h-new; \ cmp -s git-version.h git-version.h-new || cp git-version.h-new git-version.h; \ rm git-version.h-new) gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -pthread -I/mnt/usb/usr/include/glib-2.0 -I/mnt/usb/usr/lib/glib-2.0/include -pthread -I/mnt/usb/usr/include/gstreamer-0.10 -I/mnt/usb/usr/include/glib-2.0 -I/mnt/usb/usr/lib/glib-2.0/include -I/mnt/usb/usr/include/libxml2 -pthread -I/mnt/usb/usr/include/upnp -DPKG_DATADIR=\"/mnt/usb/usr/share/gmediarender\" -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations -Wwrite-strings -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c main.c: In function 'main': main.c:242: warning: implicit declaration of function 'g_thread_get_initialized' mv -f .deps/main.Tpo .deps/main.Po gcc -std=gnu99 -Wall -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations -Wwrite-strings -o gmediarender main.o upnp.o upnp_control.o upnp_connmgr.o upnp_transport.o song-meta-data.o variable-container.o upnp_device.o upnp_renderer.o webserver.o output.o logging.o xmldoc.o xmlescape.o output_gstreamer.o -pthread -L/mnt/usb/usr/lib -lgthread-2.0 -lrt -lglib-2.0 -pthread -L/mnt/usb/usr/lib -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lglib-2.0 -pthread -L/mnt/usb/usr/lib -lupnp -lthreadutil -lixml -lm main.o: In function main': main.c:(.text+0x458): undefined reference tog_thread_get_initialized' collect2: ld returned 1 exit status make[2]: * [gmediarender] Error 1 make[2]: Leaving directory `/home/andrea/Devel/3rdy/chumby/gmrender-resurrect/src' make[1]: * [all-recursive] Error 1 make[1]: Leaving directory`/home/andrea/Devel/3rdy/chumby/gmrender-resurrect' make: *\ [all] Error 2