From bccbe567851f327a5b79975ef362d81230bad1c4 Mon Sep 17 00:00:00 2001 From: Pavel Vasin Date: Mon, 18 Feb 2013 17:26:24 +0400 Subject: [PATCH] backend: simplify code --- src/pragha-backend.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pragha-backend.c b/src/pragha-backend.c index 8b8cb9af..b18bbd12 100644 --- a/src/pragha-backend.c +++ b/src/pragha-backend.c @@ -136,11 +136,10 @@ pragha_backend_get_current_length (PraghaBackend *backend) PraghaBackendPrivate *priv = backend->priv; gint64 song_length; gboolean result; - GstFormat format = GST_FORMAT_TIME; - result = gst_element_query_duration(priv->pipeline, format, &song_length); + result = gst_element_query_duration (priv->pipeline, GST_FORMAT_TIME, &song_length); - if (!result || format != GST_FORMAT_TIME) + if (!result) return GST_CLOCK_TIME_NONE; return song_length; @@ -152,11 +151,10 @@ pragha_backend_get_current_position (PraghaBackend *backend) PraghaBackendPrivate *priv = backend->priv; gint64 song_position; gboolean result; - GstFormat format = GST_FORMAT_TIME; - result = gst_element_query_position(priv->pipeline, format, &song_position); + result = gst_element_query_position (priv->pipeline, GST_FORMAT_TIME, &song_position); - if (!result || format != GST_FORMAT_TIME) + if (!result) return GST_CLOCK_TIME_NONE; return song_position;