[vlc-commits] aout: wrap time_get in an helper function
Alexandre Janniaux
git at videolan.org
Tue Aug 18 15:09:27 CEST 2020
vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Thu Jul 23 11:50:08 2020 +0200| [fade061ad92a16cfbe4b8b94014d07bf02999610] | committer: Alexandre Janniaux
aout: wrap time_get in an helper function
Gather all use-case of time_get through a single function, allowing to
add debugging information in an easier way.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fade061ad92a16cfbe4b8b94014d07bf02999610
---
include/vlc_aout.h | 5 +++++
src/audio_output/dec.c | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index 49527f30fb..5baa460f6d 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -530,6 +530,11 @@ VLC_API void aout_FiltersChangeViewpoint(aout_filters_t *, const vlc_viewpoi
VLC_API vout_thread_t *aout_filter_GetVout(filter_t *, const video_format_t *);
+static inline int aout_TimeGet(audio_output_t *aout, vlc_tick_t *delay)
+{
+ return aout->time_get(aout, delay);
+}
+
/** @} */
#endif /* VLC_AOUT_H */
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index faa65b4d79..7aba7ae8db 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -45,7 +45,7 @@ static void aout_Drain(audio_output_t *aout)
else
{
vlc_tick_t delay;
- if (aout->time_get(aout, &delay) == 0)
+ if (aout_TimeGet(aout, &delay) == 0)
vlc_tick_sleep(delay);
}
}
@@ -283,7 +283,7 @@ static void aout_DecSynchronize(audio_output_t *aout, vlc_tick_t system_now,
aout_owner_t *owner = aout_owner (aout);
vlc_tick_t delay;
- if (aout->time_get(aout, &delay) != 0)
+ if (aout_TimeGet(aout, &delay) != 0)
return; /* nothing can be done if timing is unknown */
if (owner->sync.discontinuity)
@@ -304,7 +304,7 @@ static void aout_DecSynchronize(audio_output_t *aout, vlc_tick_t system_now,
if (jitter > 0)
{
aout_DecSilence (aout, jitter, dec_pts - delay);
- if (aout->time_get(aout, &delay) != 0)
+ if (aout_TimeGet(aout, &delay) != 0)
return;
}
}
More information about the vlc-commits
mailing list