From d1ed94491ee2c4cda59b55978d446e518a8b516e Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sat, 1 Sep 2018 11:23:33 +0100 Subject: 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 --- gst-libs/gst/player/gstplayer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c index 5ab9e03e3..e45c1af2d 100644 --- a/gst-libs/gst/player/gstplayer.c +++ b/gst-libs/gst/player/gstplayer.c @@ -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); -- cgit v1.2.1