[vlc-commits] clock: move SetDejitter to the main clock
Thomas Guillem
git at videolan.org
Mon Dec 9 12:11:53 CET 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Nov 22 17:01:22 2019 +0100| [d689a8c37f0c1f468561966fcd63a3e13faaa39c] | committer: Thomas Guillem
clock: move SetDejitter to the main clock
This function was unused, was only working for the master clock and impacted
the main_clock.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d689a8c37f0c1f468561966fcd63a3e13faaa39c
---
src/clock/clock.c | 31 ++++++++-----------------------
src/clock/clock.h | 15 ++++++++-------
2 files changed, 16 insertions(+), 30 deletions(-)
diff --git a/src/clock/clock.c b/src/clock/clock.c
index 9751a3c2de..43c44bed6e 100644
--- a/src/clock/clock.c
+++ b/src/clock/clock.c
@@ -65,7 +65,6 @@ struct vlc_clock_t
unsigned frame_rate, unsigned frame_rate_base);
void (*reset)(vlc_clock_t *clock);
vlc_tick_t (*set_delay)(vlc_clock_t *clock, vlc_tick_t delay);
- void (*set_dejitter)(vlc_clock_t *clock, vlc_tick_t delay);
vlc_tick_t (*to_system_locked)(vlc_clock_t *clock, vlc_tick_t system_now,
vlc_tick_t ts, double rate);
@@ -222,15 +221,6 @@ static vlc_tick_t vlc_clock_master_set_delay(vlc_clock_t *clock, vlc_tick_t dela
return delta;
}
-static void vlc_clock_master_set_dejitter(vlc_clock_t *clock, vlc_tick_t delay)
-{
- vlc_clock_main_t *main_clock = clock->owner;
-
- vlc_mutex_lock(&main_clock->lock);
- main_clock->output_dejitter = delay;
- vlc_mutex_unlock(&main_clock->lock);
-}
-
static vlc_tick_t
vlc_clock_monotonic_to_system_locked(vlc_clock_t *clock, vlc_tick_t now,
vlc_tick_t ts, double rate)
@@ -366,12 +356,6 @@ int vlc_clock_Wait(vlc_clock_t *clock, vlc_tick_t system_now, vlc_tick_t ts,
return -1;
}
-static void vlc_clock_slave_set_dejitter(vlc_clock_t *clock, vlc_tick_t delay)
-{
- VLC_UNUSED(clock);
- VLC_UNUSED(delay);
-}
-
vlc_clock_main_t *vlc_clock_main_New(void)
{
vlc_clock_main_t *main_clock = malloc(sizeof(vlc_clock_main_t));
@@ -445,6 +429,14 @@ void vlc_clock_main_SetInputDejitter(vlc_clock_main_t *main_clock,
vlc_mutex_unlock(&main_clock->lock);
}
+void vlc_clock_main_SetDejitter(vlc_clock_main_t *main_clock,
+ vlc_tick_t dejitter)
+{
+ vlc_mutex_lock(&main_clock->lock);
+ main_clock->output_dejitter = dejitter;
+ vlc_mutex_unlock(&main_clock->lock);
+}
+
void vlc_clock_main_ChangePause(vlc_clock_main_t *main_clock, vlc_tick_t now,
bool paused)
{
@@ -528,17 +520,11 @@ void vlc_clock_ConvertArrayToSystem(vlc_clock_t *clock, vlc_tick_t system_now,
vlc_mutex_unlock(&main_clock->lock);
}
-void vlc_clock_SetDejitter(vlc_clock_t *clock, vlc_tick_t delay)
-{
- clock->set_dejitter(clock, delay);
-}
-
static void vlc_clock_set_master_callbacks(vlc_clock_t *clock)
{
clock->update = vlc_clock_master_update;
clock->reset = vlc_clock_master_reset;
clock->set_delay = vlc_clock_master_set_delay;
- clock->set_dejitter = vlc_clock_master_set_dejitter;
clock->to_system_locked = vlc_clock_master_to_system_locked;
}
@@ -547,7 +533,6 @@ static void vlc_clock_set_slave_callbacks(vlc_clock_t *clock)
clock->update = vlc_clock_slave_update;
clock->reset = vlc_clock_slave_reset;
clock->set_delay = vlc_clock_slave_set_delay;
- clock->set_dejitter = vlc_clock_slave_set_dejitter;
clock->to_system_locked = vlc_clock_slave_to_system_locked;
}
diff --git a/src/clock/clock.h b/src/clock/clock.h
index fcb1f84975..87faab165e 100644
--- a/src/clock/clock.h
+++ b/src/clock/clock.h
@@ -79,6 +79,14 @@ void vlc_clock_main_SetFirstPcr(vlc_clock_main_t *main_clock,
void vlc_clock_main_SetInputDejitter(vlc_clock_main_t *main_clock,
vlc_tick_t delay);
+/**
+ * This function sets the dejitter delay to absorb the clock jitter
+ *
+ * Also used as the maximum delay before the synchro is considered to kick in.
+ */
+void vlc_clock_main_SetDejitter(vlc_clock_main_t *main_clock, vlc_tick_t dejitter);
+
+
/**
* This function allows changing the pause status.
*/
@@ -176,11 +184,4 @@ void vlc_clock_ConvertArrayToSystem(vlc_clock_t *clock, vlc_tick_t system_now,
vlc_tick_t *ts_array, size_t ts_count,
double rate);
-/**
- * This function sets the dejitter delay to absorb the clock jitter
- *
- * Also used as the maximum delay before the synchro is considered to kick in.
- */
-void vlc_clock_SetDejitter(vlc_clock_t *clock, vlc_tick_t delay);
-
#endif /*VLC_CLOCK_H*/
More information about the vlc-commits
mailing list