diff options
author | Philippe Normand <philn@igalia.com> | 2017-08-14 14:09:33 +0100 |
---|---|---|
committer | Philippe Normand <philn@igalia.com> | 2017-08-15 09:42:41 +0100 |
commit | 2c6736398b2670580caa631f57dd783379d075d7 (patch) | |
tree | 5779a685c47119c42254d7427e358b5a45468792 | |
parent | a923d77144e585a545a96ee73f4c3bfdca874267 (diff) | |
download | gstreamer-plugins-bad-2c6736398b2670580caa631f57dd783379d075d7.tar.gz |
player: notify of media-info update after duration change
This is a follow-up of 98b0802a981eab05e610638bf5422a08a378a68a
https://bugzilla.gnome.org/show_bug.cgi?id=786201
-rw-r--r-- | gst-libs/gst/player/gstplayer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c index ba8a03ccd..38eb27a81 100644 --- a/gst-libs/gst/player/gstplayer.c +++ b/gst-libs/gst/player/gstplayer.c @@ -1503,6 +1503,10 @@ duration_changed_signal_data_free (DurationChangedSignalData * data) static void emit_duration_changed (GstPlayer * self, GstClockTime duration) { + gboolean updated = FALSE; + + g_return_if_fail (self->cached_duration != duration); + GST_DEBUG_OBJECT (self, "Duration changed %" GST_TIME_FORMAT, GST_TIME_ARGS (duration)); @@ -1510,8 +1514,12 @@ emit_duration_changed (GstPlayer * self, GstClockTime duration) g_mutex_lock (&self->lock); if (self->media_info) { self->media_info->duration = duration; + updated = TRUE; } g_mutex_unlock (&self->lock); + if (updated) { + emit_media_info_updated_signal (self); + } if (g_signal_handler_find (self, G_SIGNAL_MATCH_ID, signals[SIGNAL_DURATION_CHANGED], 0, NULL, NULL, NULL) != 0) { |