[vlc-commits] clock: assert that there is only one master
Thomas Guillem
git at videolan.org
Mon Sep 21 14:10:33 CEST 2020
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Sep 18 14:57:55 2020 +0200| [940092fdba5438f50f5fb320dea54e98ca054303] | committer: Thomas Guillem
clock: assert that there is only one master
If a second master was created, the first one was automatically
downgraded without notifying the owner.
This was never the case since es_out.c, the only clock client (for now)
is always ensuring that only one master is created.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=940092fdba5438f50f5fb320dea54e98ca054303
---
src/clock/clock.c | 7 ++-----
src/clock/clock.h | 2 ++
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/clock/clock.c b/src/clock/clock.c
index 3001d76514..cfbb5eb6f6 100644
--- a/src/clock/clock.c
+++ b/src/clock/clock.c
@@ -565,11 +565,8 @@ vlc_clock_t *vlc_clock_main_CreateMaster(vlc_clock_main_t *main_clock,
return NULL;
vlc_mutex_lock(&main_clock->lock);
- if (main_clock->master != NULL)
- {
- vlc_clock_master_reset(main_clock->master);
- vlc_clock_set_slave_callbacks(main_clock->master);
- }
+ assert(main_clock->master == NULL);
+
vlc_clock_set_master_callbacks(clock);
main_clock->master = clock;
main_clock->rc++;
diff --git a/src/clock/clock.h b/src/clock/clock.h
index ec4c1ac985..e737339169 100644
--- a/src/clock/clock.h
+++ b/src/clock/clock.h
@@ -96,6 +96,8 @@ void vlc_clock_main_ChangePause(vlc_clock_main_t *clock, vlc_tick_t system_now,
/**
* This function creates a new master vlc_clock_t interface
*
+ * @warning There can be only one master at a given time.
+ *
* You must use vlc_clock_Delete to free it.
*/
vlc_clock_t *vlc_clock_main_CreateMaster(vlc_clock_main_t *main_clock,
More information about the vlc-commits
mailing list