[banshee] [libbanshee] Fix building with older GStreamer (bgo#613339)



commit 944607178798a41ed7fdfaecd9d676f60f0ccbf1
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sat Mar 20 11:01:01 2010 +0100

    [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.

 libbanshee/banshee-player-private.h |    7 +++++++
 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 68c6bf4..7145b1f 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 d304ce8..cc22981 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]