From a797d19bb3b40cab8ee587e8112af7a9506965f6 Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Thu, 28 Jan 2016 09:42:47 +0200 Subject: [PATCH] Get rid of wxGst_element_query_position --- src/unix/mediactrl.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/unix/mediactrl.cpp b/src/unix/mediactrl.cpp index e061da59a8..50fe86530d 100644 --- a/src/unix/mediactrl.cpp +++ b/src/unix/mediactrl.cpp @@ -83,27 +83,6 @@ // Declarations //============================================================================= -//----------------------------------------------------------------------------- -// GStreamer (most version compatibility) macros -//----------------------------------------------------------------------------- - -// In 0.9 there was a HUGE change to GstQuery and the -// gst_element_query function changed dramatically and split off -// into two separate ones -#if GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR <= 8 -# define wxGst_element_query_position(e, f, p) \ - gst_element_query(e, GST_QUERY_POSITION, f, p) -#elif GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR == 9 -// However, the actual 0.9 version has a slightly different definition -// and instead of gst_element_query_duration it has two parameters to -// gst_element_query_position instead -# define wxGst_element_query_position(e, f, p) \ - gst_element_query_position(e, f, p, 0) -#else -# define wxGst_element_query_position \ - gst_element_query_position -#endif - // Max wait time for element state waiting - GST_CLOCK_TIME_NONE for inf #define wxGSTREAMER_TIMEOUT (100 * GST_MSECOND) // Max 100 milliseconds @@ -1297,7 +1276,7 @@ wxLongLong wxGStreamerMediaBackend::GetPosition() gint64 pos; GstFormat fmtTime = GST_FORMAT_TIME; - if (!wxGst_element_query_position(m_playbin, &fmtTime, &pos) || + if (!gst_element_query_position(m_playbin, &fmtTime, &pos) || fmtTime != GST_FORMAT_TIME || pos == -1) return 0; return pos / GST_MSECOND ;