From fa31ea7ac3633d0cbb4114e84366aacc37527d41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 26 Sep 2016 13:26:36 +0300 Subject: [PATCH] player: Only report the initial duration if the query was successful --- gst-libs/gst/player/gstplayer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c index fd433bf..62cd800 100644 --- a/gst-libs/gst/player/gstplayer.c +++ b/gst-libs/gst/player/gstplayer.c @@ -1590,8 +1590,10 @@ state_changed_cb (G_GNUC_UNUSED GstBus * bus, GstMessage * msg, } check_video_dimensions_changed (self); - gst_element_query_duration (self->playbin, GST_FORMAT_TIME, &duration); - emit_duration_changed (self, duration); + if (gst_element_query_duration (self->playbin, GST_FORMAT_TIME, + &duration)) { + emit_duration_changed (self, duration); + } } if (new_state == GST_STATE_PAUSED -- 2.7.4