Commit d1b451f3 authored by Philippe Normand's avatar Philippe Normand 🥑

player: Set default position and duration value to GST_CLOCK_TIME_NONE

When the position query fails the returned value shall remain -1 instead of 0 to
avoid confusion on application side between error and beginning of media.

https://bugzilla.gnome.org/show_bug.cgi?id=797066
parent 706e41fe
......@@ -760,7 +760,7 @@ gst_player_get_property (GObject * object, guint prop_id,
g_value_get_string (value));
break;
case PROP_POSITION:{
gint64 position = 0;
gint64 position = GST_CLOCK_TIME_NONE;
gst_element_query_position (self->playbin, GST_FORMAT_TIME, &position);
g_value_set_uint64 (value, position);
......@@ -1699,7 +1699,7 @@ duration_changed_cb (G_GNUC_UNUSED GstBus * bus, G_GNUC_UNUSED GstMessage * msg,
gpointer user_data)
{
GstPlayer *self = GST_PLAYER (user_data);
gint64 duration;
gint64 duration = GST_CLOCK_TIME_NONE;
if (gst_element_query_duration (self->playbin, GST_FORMAT_TIME, &duration)) {
emit_duration_changed (self, duration);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment