diff options
author | Bertrand Lorentz <bertrand.lorentz@gmail.com> | 2010-03-20 11:01:01 +0100 |
---|---|---|
committer | Bertrand Lorentz <bertrand.lorentz@gmail.com> | 2010-03-20 11:03:29 +0100 |
commit | 944607178798a41ed7fdfaecd9d676f60f0ccbf1 (patch) | |
tree | 711ed4151fdc1b8c2974f5b9f866ceeb82ef3d4e /libbanshee | |
parent | 3ea4f46b792c65b34e25e124fe12c2de927c122f (diff) |
[libbanshee] Fix building with older GStreamer (bgo#613339)
We need to define and use our own macro to check the GStreamer version,
because GST_CHECK_VERSION was only added in 0.10.18.
Diffstat (limited to 'libbanshee')
-rw-r--r-- | libbanshee/banshee-player-private.h | 7 | ||||
-rw-r--r-- | libbanshee/banshee-player.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/libbanshee/banshee-player-private.h b/libbanshee/banshee-player-private.h index 68c6bf468..7145b1fe1 100644 --- a/libbanshee/banshee-player-private.h +++ b/libbanshee/banshee-player-private.h @@ -58,6 +58,13 @@ #define IS_BANSHEE_PLAYER(e) (e != NULL) #define SET_CALLBACK(cb_name) { if(player != NULL) { player->cb_name = cb; } } +#define BANSHEE_CHECK_GST_VERSION(major,minor,micro) \ + (GST_VERSION_MAJOR > (major) || \ + (GST_VERSION_MAJOR == (major) && GST_VERSION_MINOR > (minor)) || \ + (GST_VERSION_MAJOR == (major) && GST_VERSION_MINOR == (minor) && \ + GST_VERSION_MICRO >= (micro))) + + #ifdef WIN32 // TODO Windows doesn't like the ... varargs #define bp_debug(x) diff --git a/libbanshee/banshee-player.c b/libbanshee/banshee-player.c index d304ce8b4..cc2298193 100644 --- a/libbanshee/banshee-player.c +++ b/libbanshee/banshee-player.c @@ -31,7 +31,7 @@ #include "banshee-player-cdda.h" #include "banshee-player-missing-elements.h" #include "banshee-player-replaygain.h" -#if GST_CHECK_VERSION(0,10,25) +#if BANSHEE_CHECK_GST_VERSION(0,10,25) #include <gst/interfaces/streamvolume.h> #endif @@ -302,7 +302,7 @@ bp_set_volume (BansheePlayer *player, gdouble volume) g_return_if_fail (IS_BANSHEE_PLAYER (player)); g_return_if_fail (GST_IS_ELEMENT (player->playbin)); -#if GST_CHECK_VERSION(0,10,25) +#if BANSHEE_CHECK_GST_VERSION(0,10,25) if (gst_element_implements_interface (player->playbin, GST_TYPE_STREAM_VOLUME)) gst_stream_volume_set_volume (GST_STREAM_VOLUME (player->playbin), GST_STREAM_VOLUME_FORMAT_CUBIC, volume); else @@ -319,7 +319,7 @@ bp_get_volume (BansheePlayer *player) g_return_val_if_fail (IS_BANSHEE_PLAYER (player), 0.0); g_return_val_if_fail (GST_IS_ELEMENT (player->playbin), 0.0); gdouble volume; -#if GST_CHECK_VERSION(0,10,25) +#if BANSHEE_CHECK_GST_VERSION(0,10,25) if (gst_element_implements_interface (player->playbin, GST_TYPE_STREAM_VOLUME)) volume = gst_stream_volume_get_volume (GST_STREAM_VOLUME (player->playbin), GST_STREAM_VOLUME_FORMAT_CUBIC); else |