<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div><br></div><div>On Wed, Mar 20, 2019, at 14:08, Rémi Denis-Courmont wrote:<br></div><blockquote type="cite" id="fastmail-quoted"><div>This does not seem to make much sense. <br></div><div><br></div><div>Either taking the mutex is not necessary and it should be removed. Or it is necessary, and the value is intrinsically no longer valid once the mutex is released, such that no inferences can be made from it.<br></div><div><br></div><div>So the patch looks wrong one way or the other.<br></div></blockquote><div><br></div><div>We have a vlc_clock_SetMaster that is unused. I'll remove it since I doubt we will use it for 4.0. That way I will be able to remove the mutex here.<br></div><div><br></div><blockquote type="cite" id="fastmail-quoted"><div><br></div><div class="fastmail-quoted-gmail_quote"><div>Le 20 mars 2019 00:45:16 GMT+08:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div><blockquote style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;" class="fastmail-quoted-gmail_quote"><pre class="fastmail-quoted-k9mail"><div><hr> src/clock/clock.c | 8 ++++++++<br></div><div> src/clock/clock.h | 5 +++++<br></div><div> 2 files changed, 13 insertions(+)<br></div><div><br></div><div>diff --git a/src/clock/clock.c b/src/clock/clock.c<br></div><div>index 15a6cf68e4..bc8eff55b7 100644<br></div><div>--- a/src/clock/clock.c<br></div><div>+++ b/src/clock/clock.c<br></div><div>@@ -551,6 +551,14 @@ void vlc_clock_main_SetMaster(vlc_clock_main_t *main_clock, vlc_clock_t *clock)<br></div><div> vlc_mutex_unlock(&main_clock->lock);<br></div><div> }<br></div><div> <br></div><div>+bool vlc_clock_IsMaster(vlc_clock_t *clock)<br></div><div>+{<br></div><div>+ vlc_clock_main_t *main_clock = clock->owner;<br></div><div>+ vlc_mutex_lock(&main_clock->lock);<br></div><div>+ bool is_master = main_clock->master == clock;<br></div><div>+ vlc_mutex_unlock(&main_clock->lock);<br></div><div>+ return is_master;<br></div><div>+}<br></div><div> <br></div><div> void vlc_clock_Delete(vlc_clock_t *clock)<br></div><div> {<br></div><div>diff --git a/src/clock/clock.h b/src/clock/clock.h<br></div><div>index 8f281523d8..c11a3d1234 100644<br></div><div>--- a/src/clock/clock.h<br></div><div>+++ b/src/clock/clock.h<br></div><div>@@ -93,6 +93,11 @@ vlc_clock_t *vlc_clock_CreateSlave(const vlc_clock_t *clock);<br></div><div> */<br></div><div> void vlc_clock_Delete(vlc_clock_t *clock);<br></div><div> <br></div><div>+/**<br></div><div>+ * This function returns true if the current clock is the master one<br></div><div>+ */<br></div><div>+bool vlc_clock_IsMaster(vlc_clock_t *clock);<br></div><div>+<br></div><div> /**<br></div><div> * This function will update the clock drift and returns the drift<br></div><div> */<br></div></pre></blockquote></div><div><br></div><div>-- <br></div><div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div>https://mailman.videolan.org/listinfo/vlc-devel<br></div></blockquote><div><br></div></body></html>