Skip to content

Commit

Permalink
backend: simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
recursive-rat4 authored and matiasdelellis committed Jun 25, 2013
1 parent b3bd5bc commit bccbe56
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/pragha-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit bccbe56

Please sign in to comment.