summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2018-09-01 11:23:33 +0100
committerPhilippe Normand <philn@igalia.com>2018-09-03 12:11:42 +0100
commitd1ed94491ee2c4cda59b55978d446e518a8b516e (patch)
tree8acee9a3f0c8036fea14b2d5a9c9c3fbfabb3e66
parent0146ad219e8855fb7fe128632f3168e3b44ca9ef (diff)
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
-rw-r--r--gst-libs/gst/player/gstplayer.c4
1 files 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);