mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Ignore duration changes below 1ms during playback
This commit is contained in:
3
lib/gst/clapper/gstclapper.c
vendored
3
lib/gst/clapper/gstclapper.c
vendored
@@ -1575,7 +1575,8 @@ duration_changed_signal_data_free (DurationChangedSignalData * data)
|
|||||||
static void
|
static void
|
||||||
emit_duration_changed (GstClapper * self, GstClockTime duration)
|
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;
|
return;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Duration changed %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (self, "Duration changed %" GST_TIME_FORMAT,
|
||||||
|
@@ -454,14 +454,9 @@ class ClapperWidget extends Gtk.Grid
|
|||||||
const durationSeconds = duration / Gst.SECOND;
|
const durationSeconds = duration / Gst.SECOND;
|
||||||
const durationFloor = Math.floor(durationSeconds);
|
const durationFloor = Math.floor(durationSeconds);
|
||||||
|
|
||||||
/* Sometimes GstPlayer might re-emit
|
debug(`duration changed: ${durationSeconds}`);
|
||||||
* duration changed during playback */
|
|
||||||
if(this.controls.currentDuration === durationFloor)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this.controls.currentDuration = durationFloor;
|
|
||||||
this.controls.showHours = (durationFloor >= 3600);
|
this.controls.showHours = (durationFloor >= 3600);
|
||||||
|
|
||||||
this.controls.positionAdjustment.set_upper(durationFloor);
|
this.controls.positionAdjustment.set_upper(durationFloor);
|
||||||
this.controls.durationFormatted = Misc.getFormattedTime(durationFloor);
|
this.controls.durationFormatted = Misc.getFormattedTime(durationFloor);
|
||||||
this.controls.updateElapsedLabel();
|
this.controls.updateElapsedLabel();
|
||||||
|
Reference in New Issue
Block a user