diff --git a/lib/gst/clapper/gstclapper.c b/lib/gst/clapper/gstclapper.c index c8a6a851..06a79d41 100644 --- a/lib/gst/clapper/gstclapper.c +++ b/lib/gst/clapper/gstclapper.c @@ -1575,7 +1575,8 @@ duration_changed_signal_data_free (DurationChangedSignalData * data) static void emit_duration_changed (GstClapper * self, GstClockTime duration) { - if (self->cached_duration == duration) + if (self->cached_duration == duration + || self->cached_duration / GST_MSECOND == duration / GST_MSECOND) return; GST_DEBUG_OBJECT (self, "Duration changed %" GST_TIME_FORMAT, diff --git a/src/widget.js b/src/widget.js index 0860f886..234ff64c 100644 --- a/src/widget.js +++ b/src/widget.js @@ -454,14 +454,9 @@ class ClapperWidget extends Gtk.Grid const durationSeconds = duration / Gst.SECOND; const durationFloor = Math.floor(durationSeconds); - /* Sometimes GstPlayer might re-emit - * duration changed during playback */ - if(this.controls.currentDuration === durationFloor) - return; + debug(`duration changed: ${durationSeconds}`); - this.controls.currentDuration = durationFloor; this.controls.showHours = (durationFloor >= 3600); - this.controls.positionAdjustment.set_upper(durationFloor); this.controls.durationFormatted = Misc.getFormattedTime(durationFloor); this.controls.updateElapsedLabel();