[vlc-commits] [Git][videolan/vlc][master] 9 commits: input: es_out: move clocks to sub-structure

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Wed Mar 13 15:02:02 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
1ffb6b62 by Alexandre Janniaux at 2024-03-13T14:03:51+00:00
input: es_out: move clocks to sub-structure

- - - - -
e623cd10 by Alexandre Janniaux at 2024-03-13T14:03:51+00:00
input_clock: remove extra spacing

The header felt weird with this extra spacing to separate the type, and
the spacing wasn't even the same for every function.

- - - - -
c2afd2ef by Alexandre Janniaux at 2024-03-13T14:03:51+00:00
input_clock: early return on UpdateListener

If we don't have listener, there's nothing to update anyway, so save an
indentation level and early return at the beginning instead.

- - - - -
79ccc8a6 by Alexandre Janniaux at 2024-03-13T14:03:51+00:00
input_clock: export clock listener

Use a generic clock listener instead of the vlc_clock_t based-one so
that we can attach a different listener to the input clock, in
particular in the case of tests.

The change moves some code back to the es_out.c file, which we try to
simplify, but the creation of the clock and buffering handling as a
whole might be moved somewhere else someday.

- - - - -
adc05ec0 by Alexandre Janniaux at 2024-03-13T14:03:51+00:00
input_clock: reset cl->last on input_clock_Reset

cl->last points to the last point tracked by the clock, ensure it is set
to an invalid point like cl->ref when resetting the clock.

The assignment is not needed per se but since we were setting ref, this
allows for easier debugging and tracing.

- - - - -
87439bb1 by Alexandre Janniaux at 2024-03-13T14:03:51+00:00
input_clock: expose drift in update callback

input_clock_Update() is returning a value representing whether too much
buffer has been consumed or not, but it doesn't use any external value
to compute it.

After the update, the input_clock is running UpdateListener() to update
any code that would use the value reported by the input buffering, and
specifically the vlc_clock_t when running inside the es_out. This was
triggering a vlc_clock_Update().

vlc_clock_Update() returns the drift of the updated clock compared to
the current playback time. It wasn't used for the input clock because
this drift is always zero when the updated clock is driving the clock
bus ("master clock") and the vlc_clock_t was not added as a listener
when the input clock was not driving the clock bus.

The drift value will be reported from the clock update to the input
clock. It currently has no usage except tracing, but the usage will
replace the i_late computation in the es_out.c in the end.

- - - - -
c5e72f07 by Alexandre Janniaux at 2024-03-13T14:03:51+00:00
es_out: always create an input vlc_clock_t

When the input is not selected to drive the clock bus, no vlc_clock_t
was assigned to track the drift of the input when compared to the audio
clock or other clocks, meaning that there was no way to inspect the
behaviour of the input buffering when not master.

This commit refactors the input vlc_clock_t creation to always have a
vlc_clock_t and always update it.

- - - - -
d57c3156 by Alexandre Janniaux at 2024-03-13T14:03:51+00:00
vlc_tracer: move TraceRender to clock.c

The function is specific to clock and not used anywhere else.

- - - - -
1901c5de by Alexandre Janniaux at 2024-03-13T14:03:51+00:00
clock: trace the reported drift value

Drift includes information relative to how much the given clock is
out-of-sync with the main source of time for the current playback, and
tracing its value highlight some particular behaviour regarding the
output and how the input buffering is handled.

- - - - -


5 changed files:

- include/vlc_tracer.h
- src/clock/clock.c
- src/clock/input_clock.c
- src/clock/input_clock.h
- src/input/es_out.c


Changes:

=====================================
include/vlc_tracer.h
=====================================
@@ -258,31 +258,6 @@ static inline void vlc_tracer_TraceStreamDTS(struct vlc_tracer *tracer, const ch
                              VLC_TRACE_END);
 }
 
-static inline void vlc_tracer_TraceRender(struct vlc_tracer *tracer, const char *type,
-                                const char *id, vlc_tick_t now, vlc_tick_t pts)
-{
-    if (now != VLC_TICK_MAX && now != VLC_TICK_INVALID)
-    {
-        vlc_tracer_TraceWithTs(tracer, vlc_tick_now(),
-                               VLC_TRACE("type", type),
-                               VLC_TRACE("id", id),
-                               VLC_TRACE_TICK_NS("pts", pts),
-                               VLC_TRACE_TICK_NS("render_ts", now),
-                               VLC_TRACE_END);
-        vlc_tracer_TraceWithTs(tracer, now,
-                               VLC_TRACE("type", type),
-                               VLC_TRACE("id", id),
-                               VLC_TRACE_TICK_NS("render_pts", pts),
-                               VLC_TRACE_END);
-
-    }
-    else
-        vlc_tracer_Trace(tracer, VLC_TRACE("type", type),
-                                 VLC_TRACE("id", id),
-                                 VLC_TRACE_TICK_NS("pts", pts),
-                                 VLC_TRACE_END);
-}
-
 static inline void vlc_tracer_TraceEvent(struct vlc_tracer *tracer, const char *type,
                                          const char *id, const char *event)
 {


=====================================
src/clock/clock.c
=====================================
@@ -145,6 +145,34 @@ int vlc_clock_RegisterEvents(vlc_clock_t *clock,
             event->cbs->on_##event(event->data); \
 }
 
+static inline void TraceRender(struct vlc_tracer *tracer, const char *type,
+                               const char *id, vlc_tick_t now, vlc_tick_t pts,
+                               vlc_tick_t drift)
+{
+    if (now != VLC_TICK_MAX && now != VLC_TICK_INVALID)
+    {
+        vlc_tracer_TraceWithTs(tracer, vlc_tick_now(),
+                               VLC_TRACE("type", type),
+                               VLC_TRACE("id", id),
+                               VLC_TRACE_TICK_NS("pts", pts),
+                               VLC_TRACE_TICK_NS("render_ts", now),
+                               VLC_TRACE_TICK_NS("drift", drift),
+                               VLC_TRACE_END);
+        vlc_tracer_TraceWithTs(tracer, now,
+                               VLC_TRACE("type", type),
+                               VLC_TRACE("id", id),
+                               VLC_TRACE_TICK_NS("render_pts", pts),
+                               VLC_TRACE_TICK_NS("drift", drift),
+                               VLC_TRACE_END);
+
+    }
+    else
+        vlc_tracer_Trace(tracer, VLC_TRACE("type", type),
+                                 VLC_TRACE("id", id),
+                                 VLC_TRACE_TICK_NS("pts", pts),
+                                 VLC_TRACE_END);
+}
+
 static vlc_tick_t main_stream_to_system(vlc_clock_main_t *main_clock,
                                         vlc_tick_t ts)
 {
@@ -169,7 +197,9 @@ static void vlc_clock_main_reset(vlc_clock_main_t *main_clock)
 
 static inline void vlc_clock_on_update(vlc_clock_t *clock,
                                        vlc_tick_t system_now,
-                                       vlc_tick_t ts, double rate,
+                                       vlc_tick_t ts,
+                                       vlc_tick_t drift,
+                                       double rate,
                                        unsigned frame_rate,
                                        unsigned frame_rate_base)
 {
@@ -178,9 +208,10 @@ static inline void vlc_clock_on_update(vlc_clock_t *clock,
         clock->cbs->on_update(system_now, ts, rate, frame_rate, frame_rate_base,
                               clock->cbs_data);
 
-    if (main_clock->tracer != NULL && clock->track_str_id != NULL)
-        vlc_tracer_TraceRender(main_clock->tracer, "RENDER", clock->track_str_id,
-                               system_now, ts);
+    if (main_clock->tracer != NULL && clock->track_str_id != NULL &&
+        system_now != VLC_TICK_INVALID && system_now != VLC_TICK_MAX)
+        TraceRender(main_clock->tracer, "RENDER", clock->track_str_id,
+                    system_now, ts, drift);
 }
 
 static vlc_tick_t vlc_clock_master_update(vlc_clock_t *clock,
@@ -281,9 +312,10 @@ static vlc_tick_t vlc_clock_master_update(vlc_clock_t *clock,
     if (clock->delay > 0 && main_clock->delay < 0 && ts > -main_clock->delay)
         ts += main_clock->delay;
 
-    vlc_clock_on_update(clock, system_now, ts,
+    vlc_tick_t drift = VLC_TICK_INVALID;
+    vlc_clock_on_update(clock, system_now, ts, drift,
                         rate, frame_rate, frame_rate_base);
-    return VLC_TICK_INVALID;
+    return drift;
 }
 
 static void vlc_clock_master_reset(vlc_clock_t *clock)
@@ -316,7 +348,7 @@ static void vlc_clock_master_reset(vlc_clock_t *clock)
 
     vlc_mutex_unlock(&main_clock->lock);
 
-    vlc_clock_on_update(clock, VLC_TICK_INVALID, VLC_TICK_INVALID, 1.f, 0, 0);
+    vlc_clock_on_update(clock, VLC_TICK_INVALID, VLC_TICK_INVALID, VLC_TICK_INVALID, 1.f, 0, 0);
 }
 
 static vlc_tick_t vlc_clock_master_set_delay(vlc_clock_t *clock, vlc_tick_t delay)
@@ -427,8 +459,8 @@ static vlc_tick_t vlc_clock_slave_update(vlc_clock_t *clock,
     {
         /* If system_now is VLC_TICK_MAX, the update is forced, don't modify
          * anything but only notify the new clock point. */
-        vlc_clock_on_update(clock, VLC_TICK_MAX, ts, rate, frame_rate,
-                            frame_rate_base);
+        vlc_clock_on_update(clock, VLC_TICK_MAX, ts, VLC_TICK_INVALID,
+                            rate, frame_rate, frame_rate_base);
         return VLC_TICK_MAX;
     }
 
@@ -438,8 +470,10 @@ static vlc_tick_t vlc_clock_slave_update(vlc_clock_t *clock,
 
     vlc_mutex_unlock(&main_clock->lock);
 
-    vlc_clock_on_update(clock, computed, ts, rate, frame_rate, frame_rate_base);
-    return computed - system_now;
+    vlc_tick_t drift = computed - system_now;
+    vlc_clock_on_update(clock, computed, ts, drift, rate,
+                        frame_rate, frame_rate_base);
+    return drift;
 }
 
 static void vlc_clock_slave_reset(vlc_clock_t *clock)
@@ -452,7 +486,8 @@ static void vlc_clock_slave_reset(vlc_clock_t *clock)
 
     vlc_mutex_unlock(&main_clock->lock);
 
-    vlc_clock_on_update(clock, VLC_TICK_INVALID, VLC_TICK_INVALID, 1.0f, 0, 0);
+    vlc_clock_on_update(clock, VLC_TICK_INVALID, VLC_TICK_INVALID,
+                        VLC_TICK_INVALID, 1.0f, 0, 0);
 }
 
 static vlc_tick_t vlc_clock_slave_set_delay(vlc_clock_t *clock, vlc_tick_t delay)


=====================================
src/clock/input_clock.c
=====================================
@@ -101,7 +101,10 @@
 /* */
 struct input_clock_t
 {
-    vlc_clock_t *clock_listener;
+    struct {
+        const struct vlc_input_clock_cbs *cbs;
+        void *opaque;
+    } listener;
 
     /* Last point
      * It is used to detect unexpected stream discontinuities */
@@ -143,14 +146,17 @@ static vlc_tick_t ClockGetTsOffset( input_clock_t * );
 
 static void UpdateListener( input_clock_t *cl )
 {
-    if( cl->clock_listener )
-    {
-        const vlc_tick_t system_expected =
-            ClockStreamToSystem( cl, cl->last.stream + AvgGet( &cl->drift ) ) +
-            cl->i_pts_delay + ClockGetTsOffset( cl );
+    if (cl->listener.cbs == NULL)
+        return;
 
-        vlc_clock_Update( cl->clock_listener, system_expected, cl->last.stream, cl->rate );
-    }
+    const vlc_tick_t system_expected =
+        ClockStreamToSystem( cl, cl->last.stream + AvgGet( &cl->drift ) ) +
+        cl->i_pts_delay + ClockGetTsOffset( cl );
+
+    /* The returned drift value is ignored for now since a different
+     * value is computed by the input_clock. */
+    cl->listener.cbs->update(cl->listener.opaque, system_expected,
+                             cl->last.stream, cl->rate);
 }
 
 /*****************************************************************************
@@ -161,7 +167,8 @@ input_clock_t *input_clock_New( float rate )
     input_clock_t *cl = malloc( sizeof(*cl) );
     if( !cl )
         return NULL;
-    cl->clock_listener = NULL;
+    cl->listener.cbs = NULL;
+    cl->listener.opaque = NULL;
 
     cl->b_has_reference = false;
     cl->ref = clock_point_Create( VLC_TICK_INVALID, VLC_TICK_INVALID );
@@ -192,17 +199,18 @@ input_clock_t *input_clock_New( float rate )
 void input_clock_Delete( input_clock_t *cl )
 {
     AvgClean( &cl->drift );
-    if( cl->clock_listener )
-        vlc_clock_Delete( cl->clock_listener );
     free( cl );
 }
 
-void input_clock_AttachListener( input_clock_t *cl, vlc_clock_t *clock_listener )
+void input_clock_AttachListener(input_clock_t *cl,
+                                const struct vlc_input_clock_cbs *cbs,
+                                void *opaque)
 {
-    assert( clock_listener && cl->clock_listener == NULL );
+    assert(cbs && cl->listener.cbs == NULL);
     assert( !cl->b_has_reference );
 
-    cl->clock_listener = clock_listener;
+    cl->listener.cbs = cbs;
+    cl->listener.opaque = opaque;
 }
 
 /*****************************************************************************
@@ -304,11 +312,12 @@ vlc_tick_t input_clock_Update( input_clock_t *cl, vlc_object_t *p_log,
 void input_clock_Reset( input_clock_t *cl )
 {
     cl->b_has_reference = false;
-    cl->ref = clock_point_Create( VLC_TICK_INVALID, VLC_TICK_INVALID );
+    cl->ref = cl->last
+        = clock_point_Create( VLC_TICK_INVALID, VLC_TICK_INVALID );
     cl->b_has_external_clock = false;
 
-    if( cl->clock_listener )
-        vlc_clock_Reset( cl->clock_listener );
+    if (cl->listener.cbs != NULL && cl->listener.cbs->reset != NULL)
+        cl->listener.cbs->reset(cl->listener.opaque);
 }
 
 /*****************************************************************************


=====================================
src/clock/input_clock.h
=====================================
@@ -35,6 +35,36 @@
  */
 typedef struct input_clock_t input_clock_t;
 
+/**
+ * Callbacks for the input_clock_t listener.
+ *
+ * \see input_clock_AttachListener
+ */
+struct vlc_input_clock_cbs {
+    /**
+     * Notify the listener that the buffering made progress.
+     *
+     * \param opaque        listener private data set from
+     *                      \ref input_clock_AttachListener
+     * \param ck_system     time reference for the buffering progress
+     * \param ck_stream     progress of the buffering in tick
+     * \param rate          current playback rate for the buffering
+     *
+     * \return              how much time the playback has drifted from
+     *                      the main clock
+     */
+    vlc_tick_t (*update)(void *opaque, vlc_tick_t ck_system,
+                         vlc_tick_t ck_stream, double rate);
+
+    /**
+     * Notify the listener that the buffering needed a reset.
+     *
+     * \param opaque        listener private data set from
+     *                      \ref input_clock_AttachListener
+     */
+    void (*reset)(void *opaque);
+};
+
 /**
  * This function creates a new input_clock_t.
  *
@@ -49,16 +79,18 @@ input_clock_t *input_clock_New( float rate );
  * (input_clock_Update()).
  *
  * \param clock the input clock to attach the listener to
- * \param clock_listener clock created with vlc_clock_main_CreateInputMaster().
- * The input_clock_t will take ownership of this clock and drive the main
- * clock.
+ * \param listener an input clock listener virtual table
+ * \param opaque an opaque pointer forwarded to the listener
+ *
  */
-void input_clock_AttachListener( input_clock_t *clock, vlc_clock_t *clock_listener );
+void input_clock_AttachListener(input_clock_t *clock,
+                                const struct vlc_input_clock_cbs *clock_listener,
+                                void *opaque);
 
 /**
  * This function destroys a input_clock_t created by input_clock_New.
  */
-void           input_clock_Delete( input_clock_t * );
+void input_clock_Delete(input_clock_t *);
 
 /**
  * This function will update a input_clock_t with a new clock reference point.
@@ -82,7 +114,7 @@ vlc_tick_t input_clock_Update( input_clock_t *clock, vlc_object_t *p_log,
  *
  * The actual jitter estimation will not be reset by it.
  */
-void    input_clock_Reset( input_clock_t * );
+void input_clock_Reset( input_clock_t * );
 
 /**
  * This functions will return a deadline used to control the reading speed.
@@ -92,12 +124,12 @@ vlc_tick_t input_clock_GetWakeup( input_clock_t * );
 /**
  * This functions allows changing the actual reading speed.
  */
-void    input_clock_ChangeRate( input_clock_t *, float rate );
+void input_clock_ChangeRate(input_clock_t *, float rate);
 
 /**
  * This function allows changing the pause status.
  */
-void    input_clock_ChangePause( input_clock_t *, bool b_paused, vlc_tick_t i_date );
+void input_clock_ChangePause(input_clock_t *, bool b_paused, vlc_tick_t i_date);
 
 /**
  * This function allows rebasing the original system value date (a valid
@@ -105,7 +137,7 @@ void    input_clock_ChangePause( input_clock_t *, bool b_paused, vlc_tick_t i_da
  * When using the absolute mode, it will create a discontinuity unless
  * called immediately after a input_clock_Update.
  */
-void    input_clock_ChangeSystemOrigin( input_clock_t *, bool b_absolute, vlc_tick_t i_system );
+void input_clock_ChangeSystemOrigin(input_clock_t *, bool b_absolute, vlc_tick_t i_system);
 
 /**
  * This function returns the current rate.


=====================================
src/input/es_out.c
=====================================
@@ -78,7 +78,11 @@ typedef struct
 
     /* Clock for this program */
     input_clock_t    *p_input_clock;
-    vlc_clock_main_t *p_main_clock;
+    struct {
+        vlc_clock_main_t *main;
+        vlc_clock_t *input;
+    } clocks;
+
     /* Weak reference to the master ES clock */
     const vlc_clock_t *p_master_es_clock;
     enum vlc_clock_master_source active_clock_source;
@@ -591,7 +595,9 @@ static void EsOutDelete( es_out_t *out )
 static void ProgramDelete( es_out_pgrm_t *p_pgrm )
 {
     input_clock_Delete( p_pgrm->p_input_clock );
-    vlc_clock_main_Delete( p_pgrm->p_main_clock );
+    if (p_pgrm->clocks.input)
+        vlc_clock_Delete(p_pgrm->clocks.input);
+    vlc_clock_main_Delete(p_pgrm->clocks.main);
     if( p_pgrm->p_meta )
         vlc_meta_Delete( p_pgrm->p_meta );
     input_source_Release( p_pgrm->source );
@@ -1041,11 +1047,11 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
      * frames and not from EsOutChangePosition(), like the input clock. Indeed,
      * flush is asynchronous and the output used by the decoder may still need
      * a valid reference of the clock to output their last frames. */
-    vlc_clock_main_Reset( p_sys->p_pgrm->p_main_clock );
+    vlc_clock_main_Reset(p_sys->p_pgrm->clocks.main);
 
     /* Send the first PCR to the output clock. This will be used as a reference
      * point for the sync point. */
-    vlc_clock_main_SetFirstPcr(p_sys->p_pgrm->p_main_clock, update,
+    vlc_clock_main_SetFirstPcr(p_sys->p_pgrm->clocks.main, update,
                                i_stream_start);
 
     foreach_es_then_es_slaves(p_es)
@@ -1106,7 +1112,7 @@ static void EsOutProgramChangePause( es_out_t *out, bool b_paused, vlc_tick_t i_
     vlc_list_foreach(pgrm, &p_sys->programs, node)
     {
         input_clock_ChangePause(pgrm->p_input_clock, b_paused, i_date);
-        vlc_clock_main_ChangePause(pgrm->p_main_clock, i_date, b_paused);
+        vlc_clock_main_ChangePause(pgrm->clocks.main, i_date, b_paused);
     }
 }
 
@@ -1245,6 +1251,22 @@ static void EsOutSendEsEvent(es_out_t *out, es_out_id_t *es, int action,
     });
 }
 
+static vlc_tick_t
+ClockListenerUpdate(void *opaque, vlc_tick_t ck_system,
+                    vlc_tick_t ck_stream, double rate)
+{
+    es_out_pgrm_t *pgrm = opaque;
+    return vlc_clock_Update(pgrm->clocks.input, ck_system, ck_stream, rate);
+}
+
+static void
+ClockListenerReset(void *opaque)
+{
+    es_out_pgrm_t *pgrm = opaque;
+    vlc_clock_Reset(pgrm->clocks.input);
+}
+
+
 static void EsOutProgramHandleClockSource( es_out_t *out, es_out_pgrm_t *p_pgrm )
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
@@ -1257,6 +1279,13 @@ static void EsOutProgramHandleClockSource( es_out_t *out, es_out_pgrm_t *p_pgrm
      * handle clock source selection when the first PCR is sent (from
      * ES_OUT_SET_PCR). */
 
+
+    static const struct vlc_input_clock_cbs clock_cbs =
+    {
+        .update = ClockListenerUpdate,
+        .reset = ClockListenerReset,
+    };
+
     switch( p_sys->user_clock_source )
     {
         case VLC_CLOCK_MASTER_AUTO:
@@ -1275,11 +1304,12 @@ static void EsOutProgramHandleClockSource( es_out_t *out, es_out_pgrm_t *p_pgrm
             /* Fall-through */
         case VLC_CLOCK_MASTER_INPUT:
         {
-            vlc_clock_t *p_master_clock =
-                vlc_clock_main_CreateInputMaster( p_pgrm->p_main_clock );
+            p_pgrm->clocks.input =
+                vlc_clock_main_CreateInputMaster(p_pgrm->clocks.main);
 
-            if( p_master_clock != NULL )
-                input_clock_AttachListener( p_pgrm->p_input_clock, p_master_clock );
+            if (p_pgrm->clocks.input == NULL)
+                break;
+            input_clock_AttachListener(p_pgrm->p_input_clock, &clock_cbs, p_pgrm);
             p_pgrm->active_clock_source = VLC_CLOCK_MASTER_INPUT;
             break;
         }
@@ -1300,6 +1330,18 @@ static void EsOutProgramHandleClockSource( es_out_t *out, es_out_pgrm_t *p_pgrm
             vlc_assert_unreachable();
     }
 
+    if (p_pgrm->active_clock_source != VLC_CLOCK_MASTER_INPUT)
+    {
+        p_pgrm->clocks.input = vlc_clock_main_CreateSlave(
+            p_pgrm->clocks.main, "pcr", UNKNOWN_ES, NULL, NULL);
+
+        if (p_pgrm->clocks.input != NULL)
+        {
+            input_clock_AttachListener(p_pgrm->p_input_clock, &clock_cbs,
+                                       p_pgrm);
+        }
+    }
+
     msg_Dbg( p_input, "program(%d): using clock source: '%s'",
              p_pgrm->i_id, clock_source_str );
 }
@@ -1445,8 +1487,9 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, input_source_t *source, in
     p_pgrm->active_clock_source = VLC_CLOCK_MASTER_AUTO;
 
     struct vlc_tracer *tracer = vlc_object_get_tracer( &p_input->obj );
-    p_pgrm->p_main_clock = vlc_clock_main_New( p_input->obj.logger, tracer );
-    if( !p_pgrm->p_main_clock )
+    p_pgrm->clocks.input = NULL;
+    p_pgrm->clocks.main = vlc_clock_main_New(p_input->obj.logger, tracer);
+    if (p_pgrm->clocks.main == NULL)
     {
         free( p_pgrm );
         return NULL;
@@ -1455,7 +1498,7 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, input_source_t *source, in
     p_pgrm->p_input_clock = input_clock_New( p_sys->rate );
     if( !p_pgrm->p_input_clock )
     {
-        vlc_clock_main_Delete( p_pgrm->p_main_clock );
+        vlc_clock_main_Delete(p_pgrm->clocks.main);
         free( p_pgrm );
         return NULL;
     }
@@ -1465,13 +1508,13 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, input_source_t *source, in
     const vlc_tick_t pts_delay = p_sys->i_pts_delay + p_sys->i_pts_jitter
                                + p_sys->i_tracks_pts_delay;
     input_clock_SetJitter( p_pgrm->p_input_clock, pts_delay, p_sys->i_cr_average );
-    vlc_clock_main_SetInputDejitter( p_pgrm->p_main_clock, pts_delay );
+    vlc_clock_main_SetInputDejitter(p_pgrm->clocks.main, pts_delay );
 
     /* In case of low delay: don't use any output dejitter. This may result on
      * some audio/video glitches when starting, but low-delay is more important
      * than the visual quality if the user chose this option. */
     if (input_priv(p_input)->b_low_delay)
-        vlc_clock_main_SetDejitter(p_pgrm->p_main_clock, 0);
+        vlc_clock_main_SetDejitter(p_pgrm->clocks.main, 0);
 
     /* Append it */
     vlc_list_append(&p_pgrm->node, &p_sys->programs);
@@ -2235,17 +2278,17 @@ static void EsOutCreateDecoder( es_out_t *out, es_out_id_t *p_es )
     {
         p_es->master = true;
         p_es->p_pgrm->p_master_es_clock = p_es->p_clock =
-            vlc_clock_main_CreateMaster( p_es->p_pgrm->p_main_clock,
-                                         p_es->id.str_id,
-                                         &clock_cbs, p_es );
+            vlc_clock_main_CreateMaster(p_es->p_pgrm->clocks.main,
+                                        p_es->id.str_id,
+                                        &clock_cbs, p_es);
     }
     else
     {
         p_es->master = false;
-        p_es->p_clock = vlc_clock_main_CreateSlave( p_es->p_pgrm->p_main_clock,
-                                                    p_es->id.str_id,
-                                                    p_es->fmt.i_cat,
-                                                    &clock_cbs, p_es );
+        p_es->p_clock = vlc_clock_main_CreateSlave(p_es->p_pgrm->clocks.main,
+                                                   p_es->id.str_id,
+                                                   p_es->fmt.i_cat,
+                                                   &clock_cbs, p_es);
     }
 
     if( !p_es->p_clock )
@@ -3886,7 +3929,7 @@ static int EsOutVaPrivControlLocked( es_out_t *out, input_source_t *source,
         {
             input_clock_SetJitter(pgrm->p_input_clock,
                                   i_pts_delay, i_cr_average);
-            vlc_clock_main_SetInputDejitter(pgrm->p_main_clock, i_pts_delay);
+            vlc_clock_main_SetInputDejitter(pgrm->clocks.main, i_pts_delay);
         }
         return VLC_SUCCESS;
     }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/69ef5f36fc7a3042fe60e94df0280947e6b9d4cf...1901c5de1a76c9a14ea3b7b0b1f461c235079654

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/69ef5f36fc7a3042fe60e94df0280947e6b9d4cf...1901c5de1a76c9a14ea3b7b0b1f461c235079654
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list